Skip to content

Commit 6f3ab5a

Browse files
author
Gabriel Schulhof
committed
Demos: Complete page lifecycle description in introduction
Also, remove reference to deprecated data-rel="dialog" Fixes jquery-archivegh-7833 Closes jquery-archivegh-7864
1 parent f9f6a06 commit 6f3ab5a

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

demos/intro/index.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
<p>A <a href="../pages/">page</a> in jQuery Mobile consists of an element with a <code> data-role="page"</code> attribute. Within the "page" container, any valid HTML markup can be used, but for typical pages in jQuery Mobile, the immediate children of a "page" are divs with <code>data-role="header"</code>, <code>class="ui-content"</code>, and <code>data-role="footer"</code>. The baseline requirement for a page is only the page wrapper to support the navigation system, the rest is optional.</p>
3838

39-
<p>A page can be styled as a <a href="../pages-dialog/">dialog</a> that makes the page look like it's a modal style overlay. To give a standard page the appearance of a modal dialog, add the <strong>data-rel="dialog"</strong> attribute to the link. Transitions can also be set on dialog links.</p>
39+
<p>A page can be styled as a <a href="../pages-dialog/">dialog</a> that makes the page look like it's a modal style overlay. To give a standard page the appearance of a modal dialog, add the <strong>data-dialog="true"</strong> attribute to the page. Transitions can also be set on dialog links.</p>
4040

4141
<h2>Ajax Navigation & Transitions</h2>
4242

@@ -45,8 +45,15 @@
4545
<p>Whenever a link is clicked or a form is submitted, that event is automatically intercepted by the Ajax nav system and is used to issue an Ajax request based on the <code>href</code> or form action instead of reloading the page. While the framework waits for the Ajax response, a loader overlay is displayed.</p>
4646

4747
<p>When the requested page loads, jQuery Mobile parses the document for an element with the <code> data-role="page"</code> attribute and inserts that code into the DOM of the original page. Next, any widgets in the incoming page are enhanced to apply all the styles and behavior. The rest of the incoming page is discarded so any scripts, stylesheets or other information will not be included. The framework will also note the title of the incoming page to update the title when the new page is transitioned into view.</p>
48+
<p><strong>Note:</strong> Since jQuery Mobile can combine multiple HTML documents into a single document by loading documents via Ajax, you must take care to avoid duplicate IDs on elements across <strong>all</strong> HTML documents accessible from your application.</p>
4849

4950
<p>Now that the requested page is in the DOM and enhanced, it is animated into view with a <a href="../transitions/" data-ajax="false">transition</a>. By default, the framework applies a <strong>fade</strong> transition. To set a custom transition effect, add the <code>data-transition</code> attribute to the link. </p>
51+
<p>After the animation completes, the old page is removed from the DOM, unless</p>
52+
<ul>
53+
<li>it is the starting page.</li>
54+
<li>it has the option <code>domCache</code> set to true. You can set this option by adding the following attribute to the page element: <code>data-dom-cache="true"</code>.</li>
55+
<li>it is an internal page. The initial HTML document can contain any number of jQuery Mobile pages. The first one of these is shown when the HTML document is loaded. All these pages are considered "internal" and are never removed from the DOM.</li>
56+
</ul>
5057

5158
<h2>Content & Widgets</h2>
5259

0 commit comments

Comments
 (0)