Loading Mobile Pages without Displaying Them

<$.mobile.loadPage("newPage.php",   {data=$("form").serialize(), type="post"});

Another helpful function is .loadPage(URL, options). It downloads the mobile page from the web server using an AJAX call but does not change the mobile page to the downloaded one. Actually, .changePage() calls .loadPage() underneath to retrieve the page. Most of the options listed in Table 14.3 are also available via .loadPage(), except changeHash, dataUrl, reverse, and transition.

The .loadPage() function is useful for preloading pages in the initialization functions that you want available later but do not want to display yet. The following code shows an example of loading a page using ...

Get jQuery and JavaScript Phrasebook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.