Skip to content

Commit 098687a

Browse files
author
scottjehl
committed
added documentation for data-prefetch
1 parent a5d0a29 commit 098687a

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

docs/pages/docs-pages.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,20 @@ <h2>Redirects and linking to directories</h2>
197197

198198
<p>Learn more about the technical details of the navigation model and <a href="docs-navmodel.html">Ajax, hashes and history</a> in jQuery mobile.</p>
199199

200+
<h2>Automatically Pre-fetching Pages</h2>
201+
<p>Any HTML anchor element may specify that its page be prefetched by jQuery Mobile through the use of a data-prefetch attribute. After pagecreate, jQuery Mobile will
202+
automatically find all links in a page that have an attribute of <code>data-prefetch</code> and automatically load that page so it's available as soon as the user
203+
navigates to it.</p>
204+
205+
<p>Pre-fetching links will naturally cause additional HTTP requests that may never be used, so it's important to use this feature only in situations where it's highly
206+
likely that a page will be visited.</p>
207+
208+
209+
<pre><code>
210+
&lt;a href="foo/bar/baz" data-prefetch&gt;link text&lt;/a&gt;
211+
</code></pre>
200212

213+
<p>Pages can also be pre-fetched programmatically by calling <code>$.mobile.loadpage( url )</code></p>
201214

202215

203216
</div><!--/content-primary -->

0 commit comments

Comments
 (0)