jQuery Mobile-停止缓存 [英] jQuery Mobile - stop caching
问题描述
在我的情况下,链接加载到特殊div的包装程序中,这些包装程序是其链接的父级.
我通过pageload
事件来完成.
In my case links loading into a special div's wrapers which are parents of its links.
I do it through pageload
event.
当JQuery Mobile进行AJAX请求时,一切正常.但是,如果我单击访问的链接,则jquery mobile不会发送请求,而是显示空白页,换句话说,替换缓存中的#page1
内容.
All is ok when JQuery Mobile does AJAX requests. But if I click on visited link, jquery mobile doesn't send the request, but show me blank page, replace #page1
content from cache in other words.
我需要这些请求.
UPD
事件pagebeforeload
,pageload
在高速缓存情况下不出现. = \
Events pagebeforeload
, pageload
dont appear in cache case. =\
推荐答案
您可以指定不缓存这样的页面:
You can specify to not cache the page like this :
<div data-role="page" id="page-detail" data-dom-cache="false">
....
</div>
更新
实际上它是data-dom-cache=false
,可用于页面,链接和对话框
In fact it is data-dom-cache=false
, available for page, link and dialog
文档 http://jquerymobile.com/demos/1.2.0/docs/api/data-attributes.html
If you want avoid data prefecting for all pages, have a look here : How does one disable Caching in jQuery Mobile UI
这篇关于jQuery Mobile-停止缓存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!