我有以下代码,我想知道每次单击动态帖子或导航回主列表页面时在哪里放置代码以显示 Spinner 图像:
function initialize() {
var feed = new google.feeds.Feed("http://howtodeployit.com/category/daily-devotion/feed/");
feed.setNumEntries(8);
feed.setResultFormat(google.feeds.Feed.MIXED_FORMAT);
feed.load(function(result) {
if (!result.error) {
var container = document.getElementById("feed");
var posts = '<ul data-role="listview" data-filter="true">';
for (var i = 0; i < result.feed.entries.length; i++) {
var entry = result.feed.entries[i];
posts += '<li>';
posts += '<a href="#articlepost" onclick="showPost(' + id + ')">';
posts += '<div class="ui-li-heading">' + entry.title + '</div>' ;
posts += '<div class="ui-li-desc">' + n_date + '</div>';
posts += '</a>';
posts += '</li>';
}
posts += '</ul>';
// Append each list of posts to #devotionlist in html page
$("#devotionlist").append(posts);
//$("#devotionlist").listview('refresh');
}
});
}
google.setOnLoadCallback(initialize);
我已经尝试了一些看到的代码,但没有一个对我有用......