Monday, 11 April 2011

Trying to removing caching on JQuery Mobile

Having used JQuery Mobile beta 1.0a4.1 using the files jquery.mobile-1.0a4.1.min.js and jquery.mobile-1.0a4.1.min.css, when ever you open the dialog box in the main page, this causes JQuery Mobile to cache the history state of the page, adding the syntax #&ui-state=dialog which is fairly frustrating.

I have tried the following two methods to hide the content element so it is not saved in cache but to no prevail.

$("div[data-role*='page']").live('pagehide', function (event, ui) {
    if ($(this).children("div[data-role*='content']").is(".command-no-cache"))
        $(this).remove();
});

$('.ui-page').live('pagehide', function () { $(this).remove(); });

There has got to be a solution to this in the later versions of JQuery Mobile without altering the css or js files, or is this a known bug?

Otherwise from experience, you have to go back to v 1.0a2.1 to completely removing the cache but then you lose all the functionality of the select box which I use.

No comments: