jQuery Mobile-停止缓存 [英] jQuery Mobile - stop caching

查看:218
本文介绍了jQuery Mobile-停止缓存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的情况下,链接加载到特殊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

事件pagebeforeloadpageload在高速缓存情况下不出现. = \

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屋!

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