【问题标题】:jquery mobile conditional cachejquery移动条件缓存
【发布时间】:2012-11-10 02:47:07
【问题描述】:

是否可以使用 jquery mobile 有条件地缓存页面?

例如,每次从站点上的任何其他位置导航到页面时都应重新加载页面上的数据,除非从从该页面调用的模式对话框返回。

我只能让它做一个或另一个,总是缓存或从不缓存。

【问题讨论】:

    标签: jquery caching jquery-mobile mobile


    【解决方案1】:

    是的,您可以通过编程方式调用此函数来缓存您的页面。

    // you can get the page from where the call is being transferred from    
    var referrer =  document.referrer;
    
    
    // Use this code to disable the cache
    pageContainerElement.page({ domCache: false });
    

    并且在调用模态对话框之前,可以使用 domCache: true 调用方法

    // Use this code to cache the page
    pageContainerElement.page({ domCache: true });
    

    【讨论】:

    • 太好了,我会在星期一试试这个,我一测试就接受它作为答案。谢谢。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-09-04
    • 1970-01-01
    • 2013-10-18
    • 1970-01-01
    相关资源
    最近更新 更多