如何在jQuery mobile(1.4 beta)中更改页面?
我正在阅读不推荐使用$.mobile.changePage
的文档。
但它并没有说赞成什么,或者我可以使用什么。
是否有新的API文档页面?
我以前使用$.mobile.changePage("index.html", {reloadPage:true});
但似乎添加reloadPage:true
页面中断
从jQuery Mobile 1.4开始 ,不推荐使用$.mobile.changePage()
并替换为:
$(":mobile-pagecontainer").pagecontainer("change", "target", { options });
缩短了 ……
$.mobile.pageContainer.pagecontainer("change", "target", { options });
更短 …… (1)
$("body").pagecontainer("change", "target", { options });
注意: target是#page_id或URL。
演示
(1)默认情况下, 是pageContainer ,除非在
mobileinit
上修改$.mobile.pageContainer
。
这对我有用:
$.mobile.pageContainer.pagecontainer('change', nextPage, { transition: 'flow', reload : true });
nextpage:是下一页示例的URL(var nextPage =’nextPage.html’)