您好我想让我的内容id = postlist风格的文章,我已经准备好,我需要刷新页面(刷新)。但出于某种原因,我正在'刷新未定义'错误,我显示的帖子没有样式。未捕获ReferenceError:未定义刷新
$(document).on('pagebeforeshow', '#blogposts', function() {
//$.mobile.showPageLoadingMsg();
$.ajax({
url: "http://howtodeployit.com/category/daily-devotion/?json=recentstories&callback=",
dataType: "json",
jsonpCallback: 'successCallback',
async: true,
beforeSend: function() { $.mobile.showPageLoadingMsg(true); },
complete: function() { $.mobile.hidePageLoadingMsg(); },
success:function(data){
var result = '';
$.each(data.posts.slice(0,4), function(i, val) {
result = $('<li/>').append([$("<h3>", {html: val.title}),$("<p>", {html: val.excerpt})]).wrapInner('<a href="#devotionpost" onclick="showPost(' + val.id + ')"></a>').appendTo('#postlist');
//return (i !== 4);
});
$(result).listview(refresh);
},
其中没有叫'refresh'的变量,它是什么? –
无法看到'$(result).listview(refresh);'中的'refresh'是在任何地方定义的。如果它是一个字符串参数,请尝试将其封装在''('$(result).listview('refresh');') – mariusnn
您的意思是$(result).listview('refresh'); ? –