我将使用jQuery mobile创建一个应用程序,并通过jsonp从wordpress加载其菜单和页面。 我以可折叠集和列表视图的形式加载它的菜单,但是我一直遇到错误。 当我尝试使用以下代码刷新可折叠集时:
$(".childnev").html(list);
$.mobile.loading( 'hide');
$('.popupmenu').slideToggle('slow');
$(".childnev").collapsibleset('refresh');
$(".childsublist").listview().listview('refresh');
我遇到了这个错误。
Error: cannot call methods on collapsibleset prior to initialization;
attempted to call method 'refresh'
当我尝试通过以下代码进行刷新时。
$(".childnev").html(list);
$.mobile.loading( 'hide');
$('.popupmenu').slideToggle('slow');
$(".childnev").collapsibleset();
$(".childnev").collapsibleset('refresh');
$(".childsublist").listview().listview('refresh');
它又给了我这个错误提示。
TypeError: o[0] is undefined
我有什么遗漏或做错了吗?