JQuery Mobile - Stop Caching

In my case, links are loaded into special div wrappers that are the parents of its links. I do this through the pageload event.

Everything is fine when jQuery Mobile executes AJAX requests. But if I click on the link to the visited link, jquery mobile will not send a request, but will show me a blank page, replace the #page1 contents from the cache with other words.

I need these queries.

UPD

The pagebeforeload , pageload not displayed in the cache. = \

+4
source share
2 answers

You can specify not to cache the page as follows:

 <div data-role="page" id="page-detail" data-dom-cache="false"> .... </div> 

Update

In fact, this data-dom-cache=false , available for the page, link and dialog

Doc http://jquerymobile.com/demos/1.2.0/docs/api/data-attributes.html

If you want to avoid data prefix for all pages, look here: How to disable caching in the jQuery UI for mobile devices

+5
source

Bite my code please

 $(document).on('pagebeforeload', function(event, data) { var url = data.url; if (url.toLowerCase().indexOf("office") >= 0) { event.preventDefault(); $.get(data.absUrl, {}, function(res){ _this = $(res); if (_this.attr('data-id')>0) { var card_id = _this.attr('data-id'); $('#detail-'+card_id).empty().append(_this).trigger('create'); } }); data.deferred.reject( data.absUrl, data.options ); } }); 
0
source

All Articles