Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>1 You can place your page divs within a container element in markup.</p> <p>2 I use ASP.Net Webforms which requires a FORM element, so sometimes I add my jQM pages to a top level FORM instead of the body allowing me to use ASP.Net controls within my separate pages while sharing the same FORM element.</p> <p>3 I think you need to keep all pages within the same container, otherwise links between pages break. Here is a <strong><a href="http://jsfiddle.net/ezanker/Lt7cs/1/" rel="nofollow">jsFiddle</a></strong> with 2 pages in a container linking to eachother. Try putting them in separate containers and you will see the linking stop working.</p> <pre><code>&lt;div id="PageContainer1"&gt; &lt;div data-role="page" id="page1"&gt; &lt;div data-role="header"&gt; &lt;h1&gt;My page 1&lt;/h1&gt; &lt;/div&gt; &lt;div data-role="content"&gt; &lt;a href="#page2" data-role="button"&gt;Go to Page 2&lt;/a&gt; &lt;/div&gt; &lt;/div&gt; &lt;!-- insert separate container here &lt;/div&gt; &lt;div id="PageContainer2"&gt; --&gt; &lt;div data-role="page" id="page2" data-theme="a"&gt; &lt;div data-role="header"&gt; &lt;h1&gt;My page 2&lt;/h1&gt; &lt;/div&gt; &lt;div data-role="content"&gt; &lt;a href="#page1" data-role="button"&gt;Go to Page 1&lt;/a&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>UPDATE: As pointed out in the comments, you can certainly navigate to pages in other containers via changePage, just the standard href="#page2" links break.</p> <pre><code> $.mobile.changePage("#page2", {"pageContainer": $("#Container2")}); </code></pre> <p>I am not sure of a use case for having separate containers, perhaps code organization?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload