English 中文(简体)
停职 j 洗衣机
原标题:stop jQuery mobile from caching dynamic page

With 流动 I m 采用动态页模板,根据用户的投入插入符合习俗的内容。

这一切都奏效,但一页一经紧凑,一面显示新的价值观,如果你回来并作出新的选择。 我尝试适用以下规定:

$( #instrument ).bind( pagehide , function(){
  $(this).remove();
});

这确实删除了该页,但如果你试图回过该页,那就赢得了重新开始,我只是把我回头来。

动态内容必须添加到网页上,使用<代码>, (实际的超文本似乎很重要,因此,我在这里胜诉)否则,它就赢得了打字。 如果我使用<条码>,请上页。 内容不会格式化,但如果你回头并作出新的选择,就会发生变化。

我认识到,page beforecreate will cache the page,但似乎由于内容不格式,我无法使用任何其他方法:

我的生活中可以 t一 the!

最佳回答

使用<条码>页码查询,但<条码>页(<>>>,如显示该页能够确定所有格式。

与此类似:

$( #instrument ).bind( pagebeforeshow , function() {
  // Do your content insertion
});

$( #instrument ).bind( pageshow , function() {
  $(this).page();
});

您可能认为,这只是“吸入器”工程(更新页数时的单质更新格式),在这种情况下,你可以尝试<>>/code>。

$( #instrument ).bind( pageshow , function() {
  $(this).wrap( <div id="temporary-instrument-wrapper"> );
  $( #temporary-instrument-wrapper ).page();
  $(this).unwrap();
});
问题回答

New DOM cache management feature: On by default

Since animated page transitions require that the page you’re on and the one you’re transitioning to are both in the DOM, we add pages to the DOM as you navigate around. Until now, those pages would continue to stay in the DOM until you did a full page refresh so there was always a concern that we could hit a memory ceiling on some devices and cause the browser to slow down or even crash.

For Beta 2, we added a simple mechanism to keep the DOM tidy. It works like this: whenever a page is loaded in via Ajax, it is flagged for removal from the DOM once you navigate away to another page (technically, on pagehide). If you return to a deleted page, the browser may be able to retrieve the file from it’s cache, or it will re-request it from the sever if needed. In the case of nested lists, we remove all the pages that make up the nested list once you navigate to a page that’s not part of the list. Pages that are included in a multi-page setup won’t be affected by this feature at all – only pages brought in by Ajax are managed this way by jQuery Mobile.

A new page option called domCache controls whether to leave pages in the DOM as a way to cache them (the way things used to work) or keep the DOM clean and remove hidden pages (the new way). By default, domCache is set to false to keep the DOM size actively managed. If you set this to true, you need to take care to manage the DOM yourself and test thoroughly on a range of devices.

To set the domCache option on an individual pages in order to selectively cache a page, you can either add the data-dom-cache="true" attribute to the page container or set it programmatically like this:

elem.page({ domCache: true });

The domCache option can also be set globally. This is how to turn DOM caching back on so it works like it did originally:

$.mobile.page.prototype.options.domCache = true;

I ve fixed that problem with this simple solution:

http://www.yourdomain.com/ws.php?opcion=1&**cache_hack=+Math.random();**

The last parameter with a random makes "diferente" call and jquery mobile don t cache.-

Also add in your php script:

`header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
 header("Cache-Control: no-cache");
 header("Pragma: no-cache");`




相关问题
Write-though caching of large data sets in WCF?

We ve got a smart client that talks to a SQL Server database via WCF, displaying the entities in the database, and allowing the user to edit those entities. Some of the WCF calls return a large data ...

Clearing RSL in Cache

I have built a flex application which has a "main" project and it is assosciated with a few RSL s which are loaded and cached once i run my "main" application. The problem i am facing is that the ...

how to tell clicking "back" to load cache?

I would like for my site when someone clicks "Back" or "Forward" for the server to tell the browser to load the cache instead of reloading the entire page. I ve tested some headers and done research, ...

java plugin cache and dynamic IP host

I m trying to use Amazon S3 and Amazon Cloudfront CDN to deliver the jar files of my applet application. I m seeing several cache misses of my jars by the java plugin. This is a show-stopper for me, ...

Frequently Used metadata Hashmap

Are there any implementations of a static size hashtable that limits the entries to either the most recently or most frequently used metadata? I would prefer not to keep track of this information ...

PHP - Memcache - HTML Caching

I would like to create a caching system that will bypass some mechanisms in order to improve the performance. I have some examples: 1-) I have a dynamic PHP page that is updated every hour. The page ...

Performance of Sql subqueriesfunctions

I am currently working on a particularly complex use-case. Simplifying below :) First, a client record has a many-to-one relationship with a collection of services, that is, a single client may have ...

热门标签