Revert "Export"
[platform/framework/web/web-ui-fw.git] / libs / js / jquery-mobile-1.1.0 / docs / api / methods.html
1 <!DOCTYPE html>
2 <html>
3         <head>
4         <meta charset="utf-8">
5         <meta name="viewport" content="width=device-width, initial-scale=1">
6         <title>jQuery Mobile Docs - Methods</title>
7         <link rel="stylesheet"  href="../../css/themes/default/jquery.mobile.css" />
8         <link rel="stylesheet" href="../_assets/css/jqm-docs.css"/>
9
10         <script src="../../js/jquery.js"></script>
11         <script src="../../docs/_assets/js/jqm-docs.js"></script>
12         <script src="../../js/"></script>
13
14 </head>
15 <body>
16
17 <div data-role="page" class="type-interior">
18
19         <div data-role="header" data-theme="f">
20                 <h1>Methods</h1>
21                 <a href="../../" data-icon="home" data-iconpos="notext" data-direction="reverse">Home</a>
22                 <a href="../nav.html" data-icon="search" data-iconpos="notext" data-rel="dialog" data-transition="fade">Search</a>
23         </div><!-- /header -->
24
25         <div data-role="content">
26         <div class="content-primary">
27
28           <p>jQuery Mobile exposes several methods and properties on the $.mobile object for use in your applications.</p>
29
30
31                 <dl>
32                         <dt><code>$.mobile.changePage</code> (<em>method</em>)</dt>
33                         <dd>Programmatically change from one page to another. This method is used internally for the page loading and transitioning that occurs as a result of clicking a link or submitting a form, when those features are enabled.</dd>
34
35                         <dd>
36
37                                 <dl>
38                                         <dt><code>&#183;</code> Arguments</dt>
39                                         <dd><code>to</code> (<em>string or object</em>, required)
40 <ul>
41                                 <li>String: Absolute or relative URL. (&quot;about/us.html&quot;)</li>
42                                                         <li>Object: jQuery collection object. (<code>$("#about")</code>)</li>
43                                                 </ul>
44                                         </dd>
45
46                                         <dd><code>options</code> (<em>object</em>, optional)
47                                                 <ul>
48                                                         <li>Properties:
49                                                                 <ul>
50                                                                         <li><code>allowSamePageTransition</code> (<em>boolean</em>,     default:        false) By default, changePage() ignores requests to change to the current active page. Setting this option to true, allows the request to execute. Developers should note that some of the page transitions assume that the fromPage and toPage of a changePage request are different, so they may not animate as expected. Developers are responsible for either providing a proper transition, or turning it off for this specific case.</li>
51                                                                         <li><code>changeHash</code> (<em>boolean</em>,  default:        true) Decides if the hash in the location bar should be updated. </li>
52                                                                         <li><code>data</code> (<em>object</em> or       string, default: undefined) The data to send with an Ajax page request.
53                                                                                 <ul>
54                                                                                         <li>Used only when the 'to' argument of changePage() is a URL.</li>
55                                                                                 </ul>
56                                                                   </li>
57                                                                         <li><code>dataUrl</code> (string,       default: undefined) The URL to use when updating the browser location upon changePage completion.
58                                                                   If not specified, the value of the data-url attribute of the page element is used.</li>
59                                                                         <li><code>pageContainer</code> (jQuery collection,      default:        $.mobile.pageContainer) Specifies the element that should contain the page. </li>
60                                                                         <li><code>reloadPage</code> (<em>boolean</em>, default: false) Forces a reload of a page, even if it is already in the DOM of the page container.
61                                                                                 <ul>
62                                                                                         <li>Used only when the 'to' argument of changePage() is a URL.</li>
63                                                                                 </ul>
64                                                                         </li>
65                                                                   <li><code>reverse</code> (<em>boolean</em>,   default:        false) Decides what direction the transition will run when showing the page. </li>
66                                                                         <li><code>showLoadMsg</code> (<em>boolean</em>, default:        true) Decides whether or not to show the loading message when loading external pages.</li>
67                                                                         <li><code>role</code> (<em>string</em>, default:        undefined) The data-role value to be used when displaying the page. By default this is undefined which means rely on the value of the @data-role attribute defined on the element.</li>
68                                                                         <li><code>transition</code> (<em>string</em>,   default:        $.mobile.defaultPageTransition) The transition to use when showing the page. </li>
69                                                                         <li><code>type</code> (<em>string</em>, default: &quot;get&quot;) Specifies the method ("get" or "post") to use when making a page request.
70                                                                                 <ul>
71                                                                                         <li>Used only when the 'to' argument of changePage() is a URL.</li>
72                                                                                 </ul>
73                                                                         </li>
74                                                                 </ul>
75                                                         </li>
76                                                 </ul>
77                                         </dd>
78
79                                 </dl>
80                         </dd>
81
82                         <dd>Examples:
83                         <pre>
84                         <code>
85 <strong>//transition to the "about us" page with a slideup transition</strong>
86 $.mobile.changePage( "about/us.html", { transition: "slideup"} );
87
88 <strong>//transition to the "search results" page, using data from a form with an ID of "search""       </strong>
89 $.mobile.changePage( "searchresults.php", {
90         type: "post",
91         data: $("form#search").serialize()
92 });
93
94 <strong>//transition to the "confirm" page with a "pop" transition without tracking it in history       </strong>
95 $.mobile.changePage( "../alerts/confirm.html", {
96         transition: "pop",
97         reverse: false,
98         changeHash: false
99 });
100
101                         </code>
102                         </pre>
103
104                         </dd>
105
106
107                         <dt><code>$.mobile.loadPage</code> (<em>method</em>)</dt>
108                         <dd>Load an external page, enhance its content, and insert it into the DOM. This method is called internally by the changePage() function when its first argument is a URL. This function does not affect the current active page so it can be used to load pages in the background. The function returns a deferred promise object that gets resolved after the page has been enhanced and inserted into the document.</dd>
109
110                         <dd>
111
112                                 <dl>
113                                         <dt><code>&#183;</code> Arguments</dt>
114                                         <dd><code>url</code> (<em>string or object</em>, required) A relative or absolute URL.</dd>
115
116                                         <dd><code>options</code> (<em>object</em>, optional)
117                                                 <ul>
118                                                         <li>Properties:
119                                                                 <ul>
120                                                                         <li><code>data</code> (<em>object</em> or       string, default: undefined) The data to send with an Ajax page request. </li>
121                                                                         <li><code>loadMsgDelay</code> (<em>number (in ms)</em>, default: 50) Forced delay before the loading message is shown. This is meant to allow time for a page that has already been visited to be fetched from cache without a loading message.</li>
122                                                                         <li><code>pageContainer</code> (jQuery collection,      default:        $.mobile.pageContainer) Specifies the element that should contain the page after it is loaded. </li>
123                                                                         <li><code>reloadPage</code> (<em>boolean</em>, default: false) Forces a reload of a page, even if it is already in the DOM of the page container. </li>
124                                                                         <li><code>role</code> (<em>string</em>, default:        undefined) The data-role value to be used when displaying the page. By default this is undefined which means rely on the value of the @data-role attribute defined on the element.</li>
125                                                                         <li><code>type</code> (<em>string</em>, default: &quot;get&quot;) Specifies the method ("get" or "post") to use when making a page request.
126                                                                         </li>
127                                                                 </ul>
128                                                         </li>
129                                                 </ul>
130                                         </dd>
131
132                                 </dl>
133                         </dd>
134
135                         <dd>Examples:
136                         <pre>
137                         <code>
138 <strong>//load the "about us" page into the DOM</strong>
139 $.mobile.loadPage( "about/us.html" );
140
141 <strong>//load a "search results" page, using data from a form with an ID of "search""  </strong>
142 $.mobile.loadPage( "searchresults.php", {
143         type: "post",
144         data: $("form#search").serialize()
145 });
146                         </code>
147                         </pre>
148
149                         </dd>
150
151                         <dt><code>$.fn.jqmData(), $.fn.jqmRemoveData()</code> (<em>method</em>)</dt>
152                         <dd>When working with jQuery Mobile, <code>jqmData</code> and <code>jqmRemoveData</code> should be used in place of jQuery core's <code>data</code> and <code>removeData</code> methods (note that this includes $.fn.data, $.fn.removeData, and the $.data, $.removeData, and $.hasData utilities), as they automatically incorporate getting and setting of namespaced data attributes (even if no namespace is currently in use).</dd>
153                         <dd>
154                                 <dl>
155                                         <dt><code>&#183;</code> Arguments:</dt>
156                                         <dd>See jQuery's <a href="http://api.jquery.com/jQuery.data/">data</a> and <a href="http://api.jquery.com/jQuery.removeData/">removeData</a> methods</dd>
157                                         <strong>Note: </strong>Calling jqmData() with no argument will return <code>undefined</code>. This behavior is subject to change in future versions.
158                                         <dt><code>&#183;</code> Also:</dt>
159                                         <dd>When finding elements by their jQuery Mobile data attribute, please use the custom selector <code>:jqmData()</code>, as it automatically incorporates namespaced data attributes into the lookup when they are in use. For example, instead of calling <code>$("div[data-role='page']")</code>, you should use <code>$("div:jqmData(role='page')")</code>, which internally maps to <code>$("div[data-"+ $.mobile.ns +"role='page']")</code> without forcing you to concatenate a namespace into your selectors manually.</dd>
160                                 </dl>
161                         </dd>
162
163
164                         <dt><code>$.fn.jqmEnhanceable()</code> (<em>method</em>)</dt>
165                         <dd>For users that wish to respect <code>data-enhance=false</code> parent elements during manual enhancement or custom plugin authoring jQuery Mobile provides the <code>$.fn.jqmEnhanceable</code> filter method.</dd>
166                         <dd>
167                                 <dl>
168                                         <dt><code>&#183;</code> Settings:</dt>
169                                         <dd>If, and only if, <code>$.mobile.ignoreContentEnabled</code> is set to true, this method will traverse the parent nodes for each DOM element in the jQuery object and where it finds a <code>data-enhance=false</code> parent the child will be removed from the set.</dd>
170                                         <dt><code>&#183;</code> Warning:</dt>
171                                         <dd>The operation of traversing all parent elements can be expensive for even small jQuery object sets.</dd>
172                                 </dl>
173                         </dd>
174
175                         <dt><code>$.fn.jqmHijackable()</code> (<em>method</em>)</dt>
176                         <dd>For users that wish to respect <code>data-ajax=false</code> parent elements during custom form and link binding jQuery Mobile provides the <code>$.fn.jqmHijackable</code> filter method.</dd>
177                         <dd>
178                                 <dl>
179                                         <dt><code>&#183;</code> Settings:</dt>
180                                         <dd>If, and only if, <code>$.mobile.ignoreContentEnabled</code> is set to true, this method will traverse the parent nodes for each DOM element in the jQuery object and where it finds a <code>data-ajax=false</code> parent the child form or link will be removed from the set.</dd>
181                                         <dt><code>&#183;</code> Warning:</dt>
182                                         <dd>The operation of traversing all parent elements can be expensive for even small jQuery object sets.</dd>
183                                 </dl>
184                         </dd>
185
186                         <dt><code>$.mobile.showPageLoadingMsg</code> (<em>method</em>)</dt>
187                         <dd>Show the page loading message, which is configurable via $.mobile.loadingMessage.</dd>
188                         <dd>
189                                 <dl>
190                                         <dt><code>&#183;</code> Arguments</dt>
191                                         <dd><code>theme</code> (<em>string</em>, default: "a") The theme swatch for the message.</dd>
192                                         <dd><code>msgText</code> (<em>string</em>, default: "loading") The text of the message.</dd>
193                                         <dd><code>textonly</code> (<em>boolean</em>, default: false) If true, the "spinner" image will be hidden when the message is shown.</dd>
194                                 </dl>
195                         </dd>
196                         <dd>Examples:
197                         <pre>
198                         <code>
199 <strong>//cue the page loader</strong>
200 $.mobile.showPageLoadingMsg();
201
202 <strong>//use theme swatch "b", a custom message, and no spinner</strong>
203 $.mobile.showPageLoadingMsg("b", "This is only a test", true);
204                         </code>
205                         </pre>
206
207                         </dd>
208
209
210
211
212                         <dt><code>$.mobile.hidePageLoadingMsg</code> (<em>method</em>)</dt>
213                         <dd>Hide the page loading message, which is configurable via $.mobile.loadingMessage.</dd>
214
215                         <dd>Example:
216                         <pre>
217                         <code>
218 <strong>//hide the page loader</strong>
219 $.mobile.hidePageLoadingMsg();
220                         </code>
221                         </pre>
222
223                         </dd>
224
225                         <dt><code>$.mobile.fixedToolbars.show</code> (<em>method</em>)</dt>
226                         <dd>Utility method for displaying the fixed header and/or footer of the current active page within the viewport. Note that fixed headers/footers are never really hidden. Toggling the show/hide state of a toolbar is really toggling whether or not they are inline within the page content, or displayed within the viewport as if they were fixed.</dd>
227                         <dd>
228                                 <dl>
229                                         <dt><code>&#183;</code> Arguments</dt>
230                                         <dd><code>immediately</code> (<em>boolean</em>, optional) If true, any fixed header or footer for the current active page is displayed immediately within the viewport. If false or unspecified, the fixed header/footer will fade-in after a 100 millisecond delay. Note that other events such as a document resize or scroll event can result in an additional delay before the start of the header/footer display animation.</dd>
231                                 </dl>
232                         </dd>
233                         <dd>Example:
234                         <pre>
235                         <code>
236 <strong>// Show fixed header/footer with a fade animation.</strong>
237 $.mobile.fixedToolbars.show();
238
239 <strong>// Show fixed header/footer immediately.</strong>
240 $.mobile.fixedToolbars.show(true);
241                         </code>
242                         </pre>
243
244                         </dd>
245
246                         <dt><code>$.mobile.fixedToolbars.hide</code> (<em>method</em>)</dt>
247                         <dd>Utility method for hiding the fixed header and/or footer of the current active page.</dd>
248                         <dd>
249                                 <dl>
250                                         <dt><code>&#183;</code> Arguments</dt>
251                                         <dd><code>immediately</code> (<em>boolean</em>, optional) If true, any fixed header or footer for the current active page is immediately placed inline (back in flow) with the page content, which means it will scroll along with the content and will only be visible when viewing the top or bottom of the page within the viewport. If false or unspecified, the fixed header/footer will fade-out after a 100 millisecond delay. Note that other events such as a document resize or scroll event can result in the header/footer being immediately hidden.</dd>
252                                 </dl>
253                         </dd>
254                         <dd>Example:
255                         <pre>
256                         <code>
257 <strong>// Hide fixed header/footer with a fade animation.</strong>
258 $.mobile.fixedToolbars.hide();
259
260 <strong>// Hide fixed header/footer immediately.</strong>
261 $.mobile.fixedToolbars.hide(true);
262                         </code>
263                         </pre>
264
265                         </dd>
266
267                         <dt><code>$.mobile.path.parseUrl</code> (<em>method</em>)</dt>
268                         <dd>Utility method for parsing a URL and its relative variants into an object that makes accessing the components of the URL easy. When parsing relative variants, the resulting object will contain empty string values for missing components (like protocol, host, etc). Also, when parsing URLs that have no authority, such as tel: urls, the pathname property of the object will contain the data after the protocol/scheme colon.</dd>
269
270                         <dd>
271
272                                 <dl>
273                                         <dt><code>&#183;</code> Arguments</dt>
274                                         <dd><code>url</code> (<em>string</em>, required) A relative or absolute URL.</dd>
275
276                                         <dt><code>&#183;</code> Return Value</dt>
277                                         <dd>
278                                                 <p>This function returns an object that contains the various components of the URL as strings. The properties on the object mimic the browser's location object:</p>
279                                                 <dl>
280                                                         <dt><code>hash</code></dt>
281                                                         <dd>The fragment conponent of the URL, including the leading '#' character.</dd>
282                                                         <dt><code>host</code></dt>
283                                                         <dd>The host and port number of the URL.</dd>
284                                                         <dt><code>hostname</code></dt>
285                                                         <dd>The name of the host within the URL.</dd>
286                                                         <dt><code>href</code></dt>
287                                                         <dd>The original URL that was parsed.</dd>
288                                                         <dt><code>pathname</code></dt>
289                                                         <dd>The path of the file or directory referenced by the URL.</dd>
290                                                         <dt><code>port</code></dt>
291                                                         <dd>The port specified within the URL. Most URLs rely on the default port for the protocol used, so this may be an empty string most of the time.</dd>
292                                                         <dt><code>protocol</code></dt>
293                                                         <dd>The protocol for the URL including the trailing ':' character.</dd>
294                                                         <dt><code>search</code></dt>
295                                                         <dd>The query component of the URL including the leading '?' character.</dd>
296                                                 </dl>
297                                                 <p>But it also contains additional properties that provide access to additional components as well as some common forms of the URL developers access:</p>
298                                                 <dl>
299                                                         <dt><code>authority</code></dt>
300                                                         <dd>The username, password, and host components of the URL</dd>
301                                                         <dt><code>directory</code></dt>
302                                                         <dd>The directory component of the pathname, minus any filename.</dd>
303                                                         <dt><code>domain</code></dt>
304                                                         <dd>The protocol and authority components of the URL.</dd>
305                                                         <dt><code>filename</code></dt>
306                                                         <dd>The filename within the pathname component, minus the directory.</dd>
307                                                         <dt><code>hrefNoHash</code></dt>
308                                                         <dd>The original URL minus the fragment (hash) components.</dd>
309                                                         <dt><code>hrefNoSearch</code></dt>
310                                                         <dd>The original URL minus the query (search) and fragment (hash) components.</dd>
311                                                         <dt><code>password</code></dt>
312                                                         <dd>The password contained within the authority component.</dd>
313                                                         <dt><code>username</code></dt>
314                                                         <dd>The username contained within the authority component.</dd>
315                                                 </dl>
316                                         </dd>
317
318                                 </dl>
319                         </dd>
320
321                         <dd>Examples:
322                         <pre>
323                         <code>
324 <strong>// Parsing the Url below results an object that is returned with the
325 // following properties:
326 //
327 //  obj.href:         http://jblas:password@mycompany.com:8080/mail/inbox?msg=1234&amp;type=unread#msg-content
328 //  obj.hrefNoHash:   http://jblas:password@mycompany.com:8080/mail/inbox?msg=1234&amp;type=unread
329 //  obj.hrefNoSearch: http://jblas:password@mycompany.com:8080/mail/inbox
330 //  obj.domain:       http://jblas:password@mycompany.com:8080
331 //  obj.protocol:     http:
332 //  obj.authority:    jblas:password@mycompany.com:8080
333 //  obj.username:     jblas
334 //  obj.password:     password
335 //  obj.host:         mycompany.com:8080
336 //  obj.hostname:     mycompany.com
337 //  obj.port:         8080
338 //  obj.pathname:     /mail/inbox
339 //  obj.directory:    /mail/
340 //  obj.filename:     inbox
341 //  obj.search:       ?msg=1234&amp;type=unread
342 //  obj.hash:         #msg-content</strong>
343
344 var obj = $.mobile.path.parseUrl("http://jblas:password@mycompany.com:8080/mail/inbox?msg=1234");
345                         </code>
346                         </pre>
347
348                         </dd>
349
350
351                         <dt><code>$.mobile.path.makePathAbsolute</code> (<em>method</em>)</dt>
352                         <dd>Utility method for converting a relative file or directory path into an absolute path.</dd>
353                         <dd>
354                                 <dl>
355                                         <dt><code>&#183;</code> Arguments</dt>
356                                         <dd><code>relPath</code> (<em>string</em>, required) A relative file or directory path.</dd>
357                                         <dd><code>absPath</code> (<em>string</em>, required) An absolute file or relative path to resolve against.</dd>
358
359                                         <dt><code>&#183;</code> Return Value</dt>
360                                         <dd>This function returns a string that is an absolute version of the relative path passed in.</dd>
361
362                                 </dl>
363                         </dd>
364                         <dd>Examples:
365                         <pre>
366                         <code>
367 <strong>// Returns: /a/b/c/file.html</strong>
368 var absPath = $.mobile.path.makePathAbsolute("file.html", "/a/b/c/bar.html");
369
370 <strong>// Returns: /a/foo/file.html</strong>
371 var absPath = $.mobile.path.makePathAbsolute("../../foo/file.html", "/a/b/c/bar.html");
372
373                         </code>
374                         </pre>
375                         </dd>
376
377
378                         <dt><code>$.mobile.path.makeUrlAbsolute</code> (<em>method</em>)</dt>
379                         <dd>Utility method for converting a relative URL to an absolute URL.</dd>
380                         <dd>
381
382                                 <dl>
383                                         <dt>Arguments</dt>
384                                         <dd><code>relUrl</code> (<em>string</em>, required) A relative URL.</dd>
385                                         <dd><code>absUrl</code> (<em>string</em>, required) An absolute URL to resolve against.</dd>
386
387                                         <dt>Return Value</dt>
388                                         <dd>This function returns a string that is an absolute version of the relative URL passed in.</dd>
389
390                                 </dl>
391                         </dd>
392                         <dd>Examples:
393                         <pre>
394                         <code>
395 <strong>// Returns: http://foo.com/a/b/c/file.html</strong>
396 var absUrl = $.mobile.path.makeUrlAbsolute("file.html", "http://foo.com/a/b/c/test.html");
397
398 <strong>// Returns: http://foo.com/a/foo/file.html</strong>
399 var absUrl = $.mobile.path.makeUrlAbsolute("../../foo/file.html", "http://foo.com/a/b/c/test.html");
400
401 <strong>// Returns: http://foo.com/bar/file.html</strong>
402 var absUrl = $.mobile.path.makeUrlAbsolute("//foo.com/bar/file.html", "http://foo.com/a/b/c/test.html");
403
404 <strong>// Returns: http://foo.com/a/b/c/test.html?a=1&amp;b=2</strong>
405 var absUrl = $.mobile.path.makeUrlAbsolute("?a=1&amp;b=2", "http://foo.com/a/b/c/test.html");
406
407 <strong>// Returns: http://foo.com/a/b/c/test.html#bar</strong>
408 var absUrl = $.mobile.path.makeUrlAbsolute("#bar", "http://foo.com/a/b/c/test.html");
409
410                         </code>
411                         </pre>
412
413                         </dd>
414
415
416                         <dt><code>$.mobile.path.isSameDomain</code> (<em>method</em>)</dt>
417                         <dd>Utility method for comparing the domain of 2 URLs.</dd>
418                         <dd>
419
420                                 <dl>
421                                         <dt><code>&#183;</code> Arguments</dt>
422                                         <dd><code>url1</code> (<em>string</em>, required) A relative URL.</dd>
423                                         <dd><code>url2</code> (<em>string</em>, required) An absolute URL to resolve against.</dd>
424
425                                         <dt>Return Value</dt>
426                                         <dd>This function returns a boolean true if the domains match, false if they don't.</dd>
427
428                                 </dl>
429                         </dd>
430                         <dd>Examples:
431                         <pre>
432                         <code>
433 <strong>// Returns: true</strong>
434 var same = $.mobile.path.isSameDomain("http://foo.com/a/file.html", "http://foo.com/a/b/c/test.html");
435
436 <strong>// Returns: false</strong>
437 var same = $.mobile.path.isSameDomain("file://foo.com/a/file.html", "http://foo.com/a/b/c/test.html");
438
439 <strong>// Returns: false</strong>
440 var same = $.mobile.path.isSameDomain("https://foo.com/a/file.html", "http://foo.com/a/b/c/test.html");
441
442 <strong>// Returns: false</strong>
443 var same = $.mobile.path.isSameDomain("http://foo.com/a/file.html", "http://bar.com/a/b/c/test.html");
444
445                         </code>
446                         </pre>
447
448                         </dd>
449
450
451                         <dt><code>$.mobile.path.isRelativeUrl</code> (<em>method</em>)</dt>
452                         <dd>Utility method for determining if a URL is a relative variant.</dd>
453                         <dd>
454
455                                 <dl>
456                                         <dt><code>&#183;</code> Arguments</dt>
457                                         <dd><code>url</code> (<em>string</em>, required) A relative or absolute URL.</dd>
458
459                                         <dt><code>&#183;</code> Return Value</dt>
460                                         <dd>This function returns a boolean true if the URL is relative, false if it is absolute.</dd>
461
462                                 </dl>
463                         </dd>
464                         <dd>Examples:
465                         <pre>
466                         <code>
467 <strong>// Returns: false</strong>
468 var isRel = $.mobile.path.isRelativeUrl("http://foo.com/a/file.html");
469
470 <strong>// Returns: true</strong>
471 var isRel = $.mobile.path.isRelativeUrl("//foo.com/a/file.html");
472
473 <strong>// Returns: true</strong>
474 var isRel = $.mobile.path.isRelativeUrl("/a/file.html");
475
476 <strong>// Returns: true</strong>
477 var isRel = $.mobile.path.isRelativeUrl("file.html");
478
479 <strong>// Returns: true</strong>
480 var isRel = $.mobile.path.isRelativeUrl("?a=1&amp;b=2");
481
482 <strong>// Returns: true</strong>
483 var isRel = $.mobile.path.isRelativeUrl("#foo");
484
485
486                         </code>
487                         </pre>
488
489                         </dd>
490
491
492                         <dt><code>$.mobile.path.isAbsoluteUrl</code> (<em>method</em>)</dt>
493                         <dd>Utility method for determining if a URL is absolute.</dd>
494                         <dd>
495
496                                 <dl>
497                                         <dt><code>&#183;</code> Arguments</dt>
498                                         <dd><code>url</code> (<em>string</em>, required) A relative or absolute URL.</dd>
499
500                                         <dt><code>&#183;</code> Return Value</dt>
501                                         <dd>This function returns a boolean true if the URL is absolute, false if not.</dd>
502
503                                 </dl>
504                         </dd>
505                         <dd>Examples:
506                         <pre>
507                         <code>
508 <strong>// Returns: true</strong>
509 var isAbs = $.mobile.path.isAbsoluteUrl("http://foo.com/a/file.html");
510
511 <strong>// Returns: false</strong>
512 var isAbs = $.mobile.path.isAbsoluteUrl("//foo.com/a/file.html");
513
514 <strong>// Returns: false</strong>
515 var isAbs = $.mobile.path.isAbsoluteUrl("/a/file.html");
516
517 <strong>// Returns: false</strong>
518 var isAbs = $.mobile.path.isAbsoluteUrl("file.html");
519
520 <strong>// Returns: false</strong>
521 var isAbs = $.mobile.path.isAbsoluteUrl("?a=1&amp;b=2");
522
523 <strong>// Returns: false</strong>
524 var isAbs = $.mobile.path.isAbsoluteUrl("#foo");
525
526
527                         </code>
528                         </pre>
529
530                         </dd>
531
532
533                         <dt><code>$.mobile.base</code> (<em>methods, properties</em>)</dt>
534                         <dd>Utilities for working with generated base element. TODO: document as public API is finalized.</dd>
535
536
537
538                         <dt><code>$.mobile.silentScroll</code> (<em>method</em>)</dt>
539                         <dd>Scroll to a particular Y position without triggering scroll event listeners.</dd>
540                         <dd>
541                                 <dl>
542                                         <dt><code>&#183;</code> Arguments:</dt>
543                                         <dd><code>yPos</code> (<em>number</em>, defaults to 0). Pass any number to scroll to that Y location.</dd>
544                                 </dl>
545                         </dd>
546
547                         <dd>Examples:
548                         <pre>
549                         <code>
550 <strong>//scroll to Y 100px</strong>
551 $.mobile.silentScroll(100);
552                         </code>
553                         </pre>
554
555                         </dd>
556
557
558
559
560
561                         <dt><code>$.mobile.activePage</code> (<em>property</em>)</dt>
562                         <dd>Reference to the page currently in view.</dd>
563
564
565
566
567                 </dl>
568         </div><!--/content-secondary -->
569
570         <div class="content-secondary">
571
572                 <div data-role="collapsible" data-collapsed="true" data-theme="b" data-content-theme="d">
573
574                                 <h3>More in this section</h3>
575
576                                 <ul data-role="listview"  data-theme="c" data-dividertheme="d">
577
578                                         <li data-role="list-divider">API</li>
579                                         <li><a href="../../docs/api/globalconfig.html">Configuring defaults</a></li>
580                                         <li><a href="../../docs/api/events.html">Events</a></li>
581                                         <li data-theme="a"><a href="../../docs/api/methods.html">Methods &amp; Utilities</a></li>
582                                         <li><a href="../../docs/api/data-attributes.html">Data attribute reference</a></li>
583                                         <li><a href="../../docs/api/themes.html">Theme framework</a></li>
584                                 </ul>
585                 </div>
586         </div>
587
588 </div><!-- /content -->
589
590 <div data-role="footer" class="footer-docs" data-theme="c">
591                 <p>&copy; 2011-12 The jQuery Foundation</p>
592 </div>
593
594 </div><!-- /page -->
595
596 </body>
597 </html>