问题描述:
我在我的应用程序加载JqueryMobile页Home
和pageinit
要前往网页/移动外部页面加载页面(比如B
)现在,当我试图将B
中的页面更改为Home
(已经在DOM中并且归于data-dom-cache=true
)时,没有任何发生。我没有在页面上收到任何错误或操作。
任何建议如何让这件事情的工作。
谢谢。
答
使用绝对URL,因此您要求的网址与网页的data-url
属性相匹配。
例如,如果一个文件是在/watch/
文件夹(你的帐户的根目录内),你可以设置它的data-url
属性之前jQuery Mobile的作用:
<div data-dom-cache="true" data-role="page" data-url="/watch/default.html">
...
</div>
这样,你知道它的设置正确而且你不必担心资产的相对性。然后,当你链接到页面中使用绝对网址:
<a data-role="button" href="/watch/default.html">Go to /watch/default.html</a>
这样,当你点击Go to /watch/default.html
链接,jQuery Mobile的会搜索当前伪页面为的href
属性相匹配的与data-url
属性链接。
谢谢jasper,那很有帮助。 – chimpuz 2012-04-24 09:26:16