Squirrl
Squirrl

Reputation: 4966

Can I load all my jQuery Mobile pages at once using $.mobile.loadPage() ?

I want to load every page into the DOM at once. Can I do that? Do i use $.mobile.loadPage()? In my script.js file do I write something like this:

$('#YesNoMaybePage, #categorizePage').load("#YesNoMaybePage, #categorizePage");   

??? Thank you

Upvotes: 0

Views: 88

Answers (2)

99miles
99miles

Reputation: 11232

If you still really want to load all your 'pages' at once, you'd put them all in one file, and put each 'page' in it's own div. You'd then hide the div's for all the 'pages' except the one that you are currently showing.

As far as actually loading the pages, yes, you could do it as you suggest, as long as you change the second parameters to filenames and separate the loads as Jai suggests:

$('#YesNoMaybePage').load("YesNoMaybePage.html");
$('#categorizePage').load("categorizePage.html");

Upvotes: 2

Jai
Jai

Reputation: 74738

Yes do it this way:

$('#YesNoMaybePage').load("YesNoMaybePage.html");
$('#categorizePage').load("categorizePage.html");

This way you can load pages simultaneously.

Upvotes: 1

Related Questions