Chrome开发工具告诉我第3行有错误,但我不确定它是什么。无可否认,我是使用jQuery进行编码的新手,所以我跟随的教程可能会出错。在代码中找不到语法错误
$.ajax({
url: 'https://www.carcraft.atsbusinessandgames.com/xmls/carcraft_1-7-10Test.xml',
type: "Get",
dataType: 'xml',
success: function (result) {
}
$(result).find('Module').each(function() {
//$("#ModsList").append($(this).text());
var authors = $(this).find('authors').text();
var version = $(this).find('version').text();
var date = $(this).find('date').text();
var episode = $(this).find('episode').text();
$("#ModsList").append("<tr>" + "<td>" + $authors + "</td>" + "<td>" + $version + "</td>" + "<td>" + $date + "</td>" + "<td>" + $episode + "</td>" + "</tr>");
});
error: function() {
alert("Notify the site owner that the xml file has a syntax error and is therefore unreadable.");
}
});
这是我想通过上面的代码修改表:
<table id="ModsList">
<tr style="font-weight: bold;">
<td>Mod Name</td>
<td>Author(s)</td>
<td>Version</td>
<td>Date added/updated</td>
<td>Episode Added</td>
</tr>
</table>
哪一行是3?当你只有'authors'时为什么要使用'$ authors'? – guradio
请发布您正在收到的错误 –
您的成功回调被错误地关闭。 – hmd