jQuery Mobile has built-in prefetching, all you have to do is add the data-prefetch
attribute to the link that links to the remote page:
<a href="prefetchThisPage.html" data-prefetch> ... </a>
Source: http://jquerymobile.com/demos/1.1.0/docs/pages/page-cache.html
In general, when you pull a page through AJAX, the document.ready
function will not . However, you can use jQuery events for mobile pages, such as pageinit
. For instance:
$(document).delegate('#my-page-id', 'pageinit', function () { $.mobile.loadPage("my-projects.html", { showLoadMsg: false }); });
source share