未捕获的ReferenceError:未定义刷新 [英] Uncaught ReferenceError: refresh is not defined
问题描述
我正在尝试以内容id =帖子列表样式设置我的帖子,并且我已经准备好刷新页面(刷新).但是由于某种原因,我收到未定义刷新"错误,并且显示的帖子没有设置样式.
Hi I am trying to get my posts in content id = postlist styled and I have ready that i need to refresh the page (refresh). But for some reason I am getting 'refresh is not defined' error and my displayed posts are not styled.
$(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);
},
推荐答案
向页面动态添加新的data-role="listview"
时,请使用$(".selector").listview()
调用小部件增强功能.
When dynamically adding a new data-role="listview"
to a page, use $(".selector").listview()
to call widget enhancement.
将项目添加到现有的data-role="listview"
时,请使用$(".selector").listview("refresh")
重新增强小部件.
When adding items to an existing data-role="listview"
, use $(".selector").listview("refresh")
to re-enhance the widget.
这篇关于未捕获的ReferenceError:未定义刷新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!