如何在 jQuery mobile (1.4 beta) 中更改页面? [英] How to change page in jQuery mobile (1.4 beta)?

查看:29
本文介绍了如何在 jQuery mobile (1.4 beta) 中更改页面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在阅读 $.mobile.changePage 已被弃用的文档.

I am reading the docs that $.mobile.changePage has been deprecated.

但它并没有说支持什么,或者我可以用什么来代替.

But it doesn't say in favor of what, or what can I use instead.

是否有新的 API 文档页面?

Is there a new API documentation page for this?

我曾经使用 $.mobile.changePage("index.html", {reloadPage:true}); 但似乎添加了 reloadPage:true 页面休息

I used to use $.mobile.changePage("index.html", {reloadPage:true}); but it seems that adding reloadPage:true the page breaks

推荐答案

jQuery Mobile 1.4 起,$.mobile.changePage() 已弃用并替换为:

As of jQuery Mobile 1.4, $.mobile.changePage() is deprecated and replaced with:

$(":mobile-pagecontainer").pagecontainer("change", "target", { options });

缩短...

$.mobile.pageContainer.pagecontainer("change", "target", { options });

甚至更短...(1)

$("body").pagecontainer("change", "target", { options });

注意:target 是 #page_id 或 URL.

Note: target is #page_id or URL.

演示

<小时>

(1) 默认是 pageContainer,除非 $.mobile.pageContainer 是在 mobileinit 上修改.


(1) <body> is pageContainer by default, unless $.mobile.pageContainer is modified on mobileinit.

这篇关于如何在 jQuery mobile (1.4 beta) 中更改页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆