$(document).ready( function(){
$.get("test.xml", function(data){
$(data).children(":first").children("book").each(function()
{
var title = $(this).children("title").text();
var year = $(this).children("year").text();
var author = $(this).children("author").text();
$("#mtable").append("<tr><td>"+title+"</td><td>"+year+"</td><td>"+author+"</td></tr>");
});
});
});
<table id="mtable" border="1">
</table>
Комментариев нет:
Отправить комментарий