You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: entries/jQuery.Callbacks.xml
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -8,12 +8,12 @@
8
8
<desc>A multi-purpose callbacks list object that provides a powerful way to manage callback lists.</desc>
9
9
<longdesc>
10
10
11
-
<p>The <code>$.Callbacks()</code> function is internally used to provide the base functionality behind the jQuery <code>$.ajax()</code> and <code>$.Deferred()</code> components. It can be used as a similar base to define functionality for new components.</p>
12
-
<p><code>$.Callbacks()</code> support a number of methods including <code><ahref="/callbacks.add/">callbacks.add()</a></code>,<code><ahref="/callbacks.remove/">callbacks.remove()</a></code>, <code><ahref="/callbacks.fire/">callbacks.fire()</a></code> and <code><ahref="/callbacks.disable/">callbacks.disable()</a></code>.</p>
13
-
<h3id="getting-started">Getting started</h3>
11
+
<p>The <code>$.Callbacks()</code> function is internally used to provide the base functionality behind the jQuery <code>$.ajax()</code> and <code>$.Deferred()</code> components. It can be used as a similar base to define functionality for new components.</p>
12
+
<p><code>$.Callbacks()</code> support a number of methods including <code><ahref="/callbacks.add/">callbacks.add()</a></code>,<code><ahref="/callbacks.remove/">callbacks.remove()</a></code>, <code><ahref="/callbacks.fire/">callbacks.fire()</a></code> and <code><ahref="/callbacks.disable/">callbacks.disable()</a></code>.</p>
13
+
<h3id="getting-started">Getting started</h3>
14
14
15
-
<p>The following are two sample methods named <code>fn1</code> and <code>fn2</code>:</p>
16
-
<pre>
15
+
<p>The following are two sample methods named <code>fn1</code> and <code>fn2</code>:</p>
Copy file name to clipboardExpand all lines: entries/jQuery.browser.xml
+12-11Lines changed: 12 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -4,19 +4,20 @@
4
4
<longdesc>
5
5
<p>The <code>$.browser</code> property provides information about the web browser that is accessing the page, as reported by the browser itself. It contains flags for each of the four most prevalent browser classes (Internet Explorer, Mozilla, Webkit, and Opera) as well as version information.</p>
6
6
7
-
<p>Available flags are:</p>
8
-
<ul>
9
-
<li>webkit (as of jQuery 1.4)</li>
10
-
<li>safari (deprecated)</li>
11
-
<li>opera</li>
12
-
<li>msie</li>
13
-
<li>mozilla</li>
14
-
</ul>
7
+
<p>Available flags are:</p>
8
+
<ul>
9
+
<li>webkit (as of jQuery 1.4)</li>
10
+
<li>safari (deprecated)</li>
11
+
<li>opera</li>
12
+
<li>msie</li>
13
+
<li>mozilla</li>
14
+
</ul>
15
15
16
-
<p>This property is available immediately. It is therefore safe to use it to determine whether or not to call <code>$(document).ready()</code>.
17
-
The <code>$.browser</code> property is deprecated in jQuery 1.3, and its functionality may be moved to a team-supported plugin in a future release of jQuery.</p>
16
+
<p>This property is available immediately. It is therefore safe to use it to determine whether or not to call <code>$(document).ready()</code>.
17
+
The <code>$.browser</code> property is deprecated in jQuery 1.3, and its functionality may be moved to a team-supported plugin in a future release of jQuery.</p>
18
18
19
-
<p>Because <code>$.browser</code> uses <code>navigator.userAgent</code> to determine the platform, it is vulnerable to spoofing by the user or misrepresentation by the browser itself. It is always best to avoid browser-specific code entirely where possible. The <code><ahref="http://api.jquery.com/jQuery.support/">$.support</a></code> property is available for detection of support for particular features rather than relying on <code>$.browser</code>. </p></longdesc>
19
+
<p>Because <code>$.browser</code> uses <code>navigator.userAgent</code> to determine the platform, it is vulnerable to spoofing by the user or misrepresentation by the browser itself. It is always best to avoid browser-specific code entirely where possible. The <code><ahref="http://api.jquery.com/jQuery.support/">$.support</a></code> property is available for detection of support for particular features rather than relying on <code>$.browser</code>. </p>
Copy file name to clipboardExpand all lines: entries/jQuery.getScript.xml
+17-17Lines changed: 17 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -16,30 +16,30 @@
16
16
success: <em>success</em>
17
17
});
18
18
</pre>
19
-
<p>The script is executed in the global context, so it can refer to other variables and use jQuery functions. Included scripts can have some impact on the current page.</p>
20
-
<h4id="success-callback">
21
-
Success Callback
22
-
</h4>
23
-
<p>The callback is passed the returned JavaScript file. This is generally not useful as the script will already have run at this point.</p>
24
-
<pre>$(".result").html("<p>Lorem ipsum dolor sit amet.</p>");</pre>
25
-
<p>Scripts are included and run by referencing the file name:</p>
19
+
<p>The script is executed in the global context, so it can refer to other variables and use jQuery functions. Included scripts can have some impact on the current page.</p>
20
+
<h4id="success-callback">
21
+
Success Callback
22
+
</h4>
23
+
<p>The callback is passed the returned JavaScript file. This is generally not useful as the script will already have run at this point.</p>
24
+
<pre>$(".result").html("<p>Lorem ipsum dolor sit amet.</p>");</pre>
25
+
<p>Scripts are included and run by referencing the file name:</p>
<p>Be default, <code>$.getScript()</code> sets the cache setting to <code>false</code>. This appends a timestamped query parameter to the request URL to ensure that the browser downloads the script each time it is requested. You can override this feature by setting the cache property globally using <ahref="http://api.jquery.com/jquery.ajaxsetup/"><code>$.ajaxSetup()</code></a>: </p>
52
+
<h4id="caching-requests">Caching Responses</h4>
53
+
<p>Be default, <code>$.getScript()</code> sets the cache setting to <code>false</code>. This appends a timestamped query parameter to the request URL to ensure that the browser downloads the script each time it is requested. You can override this feature by setting the cache property globally using <ahref="http://api.jquery.com/jquery.ajaxsetup/"><code>$.ajaxSetup()</code></a>: </p>
54
54
<pre>
55
55
$.ajaxSetup({
56
56
cache: true
57
57
});
58
58
</pre>
59
-
<p>Alternatively, you could define a new method that uses the more flexible <code>$.ajax()</code> method.</p>
60
-
</longdesc>
59
+
<p>Alternatively, you could define a new method that uses the more flexible <code>$.ajax()</code> method.</p>
60
+
</longdesc>
61
61
<example>
62
62
<desc>Define a $.cachedScript() method that allows fetching a cached script:</desc>
<desc>Load the <ahref="http://github.com/jquery/jquery-color">official jQuery Color Animation plugin</a> dynamically and bind some color animations to occur once the new functionality is loaded.</desc>
85
-
<code><![CDATA[
83
+
<example>
84
+
<desc>Load the <ahref="http://github.com/jquery/jquery-color">official jQuery Color Animation plugin</a> dynamically and bind some color animations to occur once the new functionality is loaded.</desc>
<desc>Execute some JavaScript code globally.</desc>
9
-
<longdesc><p>This method behaves differently from using a normal JavaScript <code>eval()</code> in that it's executed within the global context (which is important for loading external scripts dynamically).</p></longdesc>
10
-
<example>
11
-
<desc>Execute a script in the global context.</desc>
<desc>Execute some JavaScript code globally.</desc>
9
+
<longdesc>
10
+
<p>This method behaves differently from using a normal JavaScript <code>eval()</code> in that it's executed within the global context (which is important for loading external scripts dynamically).</p>
11
+
</longdesc>
12
+
<example>
13
+
<desc>Execute a script in the global context.</desc>
Copy file name to clipboardExpand all lines: entries/jQuery.hasData.xml
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -7,11 +7,11 @@
7
7
</signature>
8
8
<desc>Determine whether an element has any jQuery data associated with it.</desc>
9
9
<longdesc><p>The <code>jQuery.hasData()</code> method provides a way to determine if an element currently has any values that were set using <code><ahref='/jQuery.data'>jQuery.data()</a></code>. If no data is associated with an element (there is no data object at all or the data object is empty), the method returns <code>false</code>; otherwise it returns <code>true</code>.</p>
10
-
<p>The primary advantage of <code>jQuery.hasData(element)</code> is that it does not create and associate a data object with the element if none currently exists. In contrast, <code>jQuery.data(element)</code> always returns a data object to the caller, creating one if no data object previously existed.
10
+
<p>The primary advantage of <code>jQuery.hasData(element)</code> is that it does not create and associate a data object with the element if none currently exists. In contrast, <code>jQuery.data(element)</code> always returns a data object to the caller, creating one if no data object previously existed.
11
11
</p>
12
-
<p>Note that jQuery's event system uses the jQuery data API to store event handlers. Therefore, binding an event to an element using <code>.on()</code>, <code>.bind()</code>, <code>.live()</code>, <code>.delegate()</code>, or one of the shorthand event methods also associates a data object with that element.
12
+
<p>Note that jQuery's event system uses the jQuery data API to store event handlers. Therefore, binding an event to an element using <code>.on()</code>, <code>.bind()</code>, <code>.live()</code>, <code>.delegate()</code>, or one of the shorthand event methods also associates a data object with that element.
13
13
</p>
14
-
</longdesc>
14
+
</longdesc>
15
15
<example>
16
16
<desc>Set data on an element and see the results of hasData.</desc>
<desc>Holds or releases the execution of jQuery's ready event.</desc>
3
-
<signature>
4
-
<added>1.6</added>
5
-
<argumentname="hold"type="Boolean">
6
-
<desc>Indicates whether the ready hold is being requested or released</desc>
7
-
</argument>
8
-
</signature>
9
-
10
-
<longdesc>
11
-
<p>The <code>$.holdReady()</code> method allows the caller to delay jQuery's ready event. This <em>advanced feature</em> would typically be used by dynamic script loaders that want to load additional JavaScript such as jQuery plugins before allowing the ready event to occur, even though the DOM may be ready. This method must be called early in the document, such as in the <code><head></code> immediately after the jQuery script tag. Calling this method after the ready event has already fired will have no effect. </p>
12
-
<p>To delay the ready event, first call <code>$.holdReady(true)</code>. When the ready event should be released to execute, call <code>$.holdReady(false)</code>. Note that multiple holds can be put on the ready event, one for each <code>$.holdReady(true)</code> call. The ready event will not actually fire until all holds have been released with a corresponding number of <code>$.holdReady(false)</code> calls <em>and</em> the normal document ready conditions are met. (See <ahref="http://api.jquery.com/ready/"><code>ready</code></a> for more information.)</p>
13
-
</longdesc>
3
+
<signature>
4
+
<added>1.6</added>
5
+
<argumentname="hold"type="Boolean">
6
+
<desc>Indicates whether the ready hold is being requested or released</desc>
7
+
</argument>
8
+
</signature>
9
+
<longdesc>
10
+
<p>The <code>$.holdReady()</code> method allows the caller to delay jQuery's ready event. This <em>advanced feature</em> would typically be used by dynamic script loaders that want to load additional JavaScript such as jQuery plugins before allowing the ready event to occur, even though the DOM may be ready. This method must be called early in the document, such as in the <code><head></code> immediately after the jQuery script tag. Calling this method after the ready event has already fired will have no effect. </p>
11
+
<p>To delay the ready event, first call <code>$.holdReady(true)</code>. When the ready event should be released to execute, call <code>$.holdReady(false)</code>. Note that multiple holds can be put on the ready event, one for each <code>$.holdReady(true)</code> call. The ready event will not actually fire until all holds have been released with a corresponding number of <code>$.holdReady(false)</code> calls <em>and</em> the normal document ready conditions are met. (See <ahref="http://api.jquery.com/ready/"><code>ready</code></a> for more information.)</p>
12
+
</longdesc>
14
13
<example>
15
-
<desc>Delay the ready event until a custom plugin has loaded.</desc>
16
-
<code><![CDATA[
14
+
<desc>Delay the ready event until a custom plugin has loaded.</desc>
0 commit comments