上述JS纯html代码
[HTML] 纯文本查看 复制代码 <script src="http://www.kevin-ying.com/jq/jquery-2.1.4.min.js"></script>
<script>
$(document).ready(function()
{
$.get('/data/rss/10.xml', function(d){
$('body').append('<h1> Saturn给你推荐几本书: </h1>');
$('body').append('<dl />');
$(d).find('book').each(function(){
var $book = $(this);
var title = $book.attr("title");
var description = $book.find('description').text();
var imageurl = $book.attr('imageurl');
var html = '<dt> <img class="bookImage" alt="" src="' + imageurl + '" /> </dt>';
html += '<dd> <span class="loadingPic" alt="Loading" />';
html += '<p class="title">' + title + '</p>';
html += '<p> ' + description + '</p>' ;
html += '</dd>';
$('dl').append($(html));
$('.loadingPic').fadeOut(2000);
});
});
});
</script>
|