0

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

2 Answers 2

2

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");
1
  • Thanks buddy. I'll let it go :)
    – Squirrl
    Jan 15, 2013 at 6:31
1

Yes do it this way:

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

This way you can load pages simultaneously.

5
  • Sure, you could do that, except that you wouldn't load the contents from one element into that same element, or have filenames that look like "#YesNoMaybePage"
    – 99miles
    Jan 15, 2013 at 6:23
  • Yes thats the OPs version of code he would understant it. i think.
    – Jai
    Jan 15, 2013 at 6:24
  • although i have put extension .html here.
    – Jai
    Jan 15, 2013 at 6:25
  • Thanks Jai. 99miles was helping me from a previous question. I wanted to move list items around from one page to another and he recommended that I include a database instead of attempting to do this only using jQuery.
    – Squirrl
    Jan 15, 2013 at 6:33
  • 1
    For the record, here's his previous post stackoverflow.com/questions/14331317/…
    – 99miles
    Jan 15, 2013 at 6:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.