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