<commit_before><!DOCTYPE html> 
<html> 
	<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1"> 
	<title>jQuery Mobile Docs - Methods</title> 
	<link rel="stylesheet"  href="../../themes/default/" /> 
	<link rel="stylesheet" href="../_assets/css/jqm-docs.css"/>
	<script type="text/javascript" src="../../js/jquery.js"></script>
	<script type="text/javascript" src="../../js/"></script>
</head> 
<body> 

<div data-role="page" data-theme="b">

	<div data-role="header">
		<h1>Methods</h1>
		<a href="../../" data-icon="home" data-iconpos="notext" data-direction="reverse" class="ui-btn-right jqm-home">Home</a>
	</div><!-- /header -->

	<div data-role="content">
	

		<p>jQuery Mobile exposes several methods and properties on the $.mobile object for use in your applications.</p>
		

		<dl>
			<dt><code>$.mobile.changePage</code> (<em>method</em>)</dt>
			<dd>Programmatically change from one page to another. This method is used internally for transitions that occur as a result of clicking a link or submitting a form, when those features are enabled.</dd>
			
			<dd>
				
				<dl>
					<dt>Arguments</dt>
					<dd><code>to</code>					
						<ul>
							<li>String, url to transition to (<code>"about/us.html"</code>)</li>
							<li>jQuery object (<code>$("#about")</code>)</li>
							<li>Array specifying two page references [from,to] for transitioning from a known page. From is otherwise assumed to be the current page in view (or $.mobile.activePage ).</li>
							<li>Object for sending form data. (<code>{to: url, data: serialized form data, type: "get" or "post"}</code></li>  
						</ul>	
						</dd>	
						
					<dd><code>transition</code> (<em>string</em>, examples: "pop", "slide"," "none")</dd>
					<dd><code>reverse</code> (<em>boolean</em>, default: false). True will cause a reverse-direction transition.</dd>
					<dd><code>changeHash</code> (<em>boolean</em>, default: true). Update the hash to the to page's URL when page change is complete.</dd>
				</dl>
			</dd>
			
			<dd>Examples:
			<pre>
			<code>
<strong>//transition to the "about us" page with a slideup transition</strong> 			
$.mobile.changePage("about/us.html", "slideup");	

<strong>//transition to the "search results" page, using data from a form with an ID of "search"" 	</strong>	
$.mobile.changePage({
	url: "searchresults.php", 
	type: "get", 
	data: $("form#search").serialize()
});		

<strong>//transition to the "confirm" page with a "pop" transition without tracking it in history	</strong>		
$.mobile.changePage("../alerts/confirm.html", "pop", false, false);	
		
			</code>
			</pre>
			
			</dd>
			
			<dt><code>$.mobile.pageLoading</code> (<em>method</em>)</dt>
			<dd>Show or hide the page loading message, which is configurable via $.mobile.loadingMessage.</dd>
			<dd>
				<dl>
					<dt>Arguments:</dt>
					<dd><code>Done</code> (<em>boolean</em>, defaults to false, meaning loading has started). True will hide the loading message.</dd>
				</dl>
			</dd>
			
			<dd>Examples:
			<pre>
			<code>
<strong>//cue the page loader</strong> 			<commit_msg>documented the  new jqmData method and :jqmData selector.<commit_after><!DOCTYPE html> 
<html> 
	<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1"> 
	<title>jQuery Mobile Docs - Methods</title> 
	<link rel="stylesheet"  href="../../themes/default/" /> 
	<link rel="stylesheet" href="../_assets/css/jqm-docs.css"/>
	<script type="text/javascript" src="../../js/jquery.js"></script>
	<script type="text/javascript" src="../../js/"></script>
</head> 
<body> 

<div data-role="page" data-theme="b">

	<div data-role="header">
		<h1>Methods</h1>
		<a href="../../" data-icon="home" data-iconpos="notext" data-direction="reverse" class="ui-btn-right jqm-home">Home</a>
	</div><!-- /header -->

	<div data-role="content">
	

		<p>jQuery Mobile exposes several methods and properties on the $.mobile object for use in your applications.</p>
		

		<dl>
			<dt><code>$.mobile.changePage</code> (<em>method</em>)</dt>
			<dd>Programmatically change from one page to another. This method is used internally for transitions that occur as a result of clicking a link or submitting a form, when those features are enabled.</dd>
			
			<dd>
				
				<dl>
					<dt>Arguments</dt>
					<dd><code>to</code>					
						<ul>
							<li>String, url to transition to (<code>"about/us.html"</code>)</li>
							<li>jQuery object (<code>$("#about")</code>)</li>
							<li>Array specifying two page references [from,to] for transitioning from a known page. From is otherwise assumed to be the current page in view (or $.mobile.activePage ).</li>
							<li>Object for sending form data. (<code>{to: url, data: serialized form data, type: "get" or "post"}</code></li>  
						</ul>	
						</dd>	
						
					<dd><code>transition</code> (<em>string</em>, examples: "pop", "slide"," "none")</dd>
					<dd><code>reverse</code> (<em>boolean</em>, default: false). True will cause a reverse-direction transition.</dd>
					<dd><code>changeHash</code> (<em>boolean</em>, default: true). Update the hash to the to page's URL when page change is complete.</dd>
				</dl>
			</dd>
			
			<dd>Examples:
			<pre>
			<code>
<strong>//transition to the "about us" page with a slideup transition</strong> 			
$.mobile.changePage("about/us.html", "slideup");	

<strong>//transition to the "search results" page, using data from a form with an ID of "search"" 	</strong>	
$.mobile.changePage({
	url: "searchresults.php", 
	type: "get", 
	data: $("form#search").serialize()
});		

<strong>//transition to the "confirm" page with a "pop" transition without tracking it in history	</strong>		
$.mobile.changePage("../alerts/confirm.html", "pop", false, false);	
		
			</code>
			</pre>
			
			</dd>
			
			
			<dt><code>jqmData()</code> (<em>method</em>)</dt>
			<dd>When working with jQuery Mobile, <code>jqmData</code> should be used in place of jQuery core's <code>data</code> method, as it automatically incorporates getting and setting of namespaced data attributes (even if no namespace is currently in use).</dd>
			<dd>
				<dl>
					<dt>Arguments:</dt>
					<dd>See jQuery's data method: http://api.jquery.com/jQuery.data/</dd>
					<dt>Also:</dt>
					<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>
				</dl>
			</dd>

			
			
			
			<dt><code>$.mobile.pageLoading</code> (<em>method</em>)</dt>
			<dd>Show or hide the page loading message, which is configurable via $.mobile.loadingMessage.</dd>
			<dd>
				<dl>
					<dt>Arguments:</dt>
					<dd><code>Done</code> (<em>boolean</em>, defaults to false, meaning loading has started). True will hide the loading message.</dd>
				</dl>
			</dd>
			
			<dd>Examples:
			<pre>
			<code>
<strong>//cue the page loader</strong> 			
{'fraction_non_alphanumeric': 0.18159408381265407, 'fraction_numerical': 0.001369487811558477, 'mean_word_length': 3.527588344699318, 'pattern_counts': {'":': 0, '<': 267, '<?xml version=': 0, '>': 267, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3179266', 'n_tokens_mistral': 2755, 'n_tokens_neox': 2305, 'n_words': 695}