|
4 | 4 | <signature>
|
5 | 5 | <added>1.3</added>
|
6 | 6 | </signature>
|
7 |
| - <desc>A collection of properties that represent the presence of different browser features or bugs. Primarily intended for jQuery's internal use; specific properties may be removed when they are no longer needed internally to improve page startup performance.</desc> |
8 |
| - <longdesc> |
9 |
| - <p>Rather than using <code>$.browser</code> to detect the current user agent and alter the page presentation based on which browser is running, it is a good practice to use <strong>feature detection</strong>. To make this process simpler, jQuery performs many such tests and sets properties of the <code>jQuery.support</code> object.</p> |
10 |
| - <p> |
11 |
| - <strong>Since jQuery requires these tests internally, they must be performed on <em>every</em> page load. Although some of these properties are documented below, they are not subject to a long deprecation/removal cycle and may be removed once internal jQuery code no longer needs them.</strong> |
12 |
| - </p> |
13 |
| - <div class="warning"> |
14 |
| - <p>Following are a few resources that explain how feature detection works:</p> |
15 |
| - <ul> |
16 |
| - <li> |
17 |
| - <a href="http://peter.michaux.ca/articles/feature-detection-state-of-the-art-browser-scripting">http://peter.michaux.ca/articles/feature-detection-state-of-the-art-browser-scripting</a> |
18 |
| - </li> |
19 |
| - <li> |
20 |
| - <a href="http://www.jibbering.com/faq/faq_notes/not_browser_detect.html">http://www.jibbering.com/faq/faq_notes/not_browser_detect.html</a> |
21 |
| - </li> |
22 |
| - <li> |
23 |
| - <a href="http://yura.thinkweb2.com/cft/">http://yura.thinkweb2.com/cft/</a> |
24 |
| - </li> |
25 |
| - </ul> |
26 |
| - </div> |
27 |
| - <p>For your own project's feature-detection needs, we strongly recommend the use of an external library such as <a href="http://modernizr.com">Modernizr</a> instead of dependency on properties in <code>jQuery.support</code>.</p> |
28 |
| - <p>The tests included in <code>jQuery.support</code> are as follows:</p> |
29 |
| - <ul> |
30 |
| - <li><code>ajax</code> is equal to true if a browser is able to create an <code>XMLHttpRequest</code> object.</li> |
31 |
| - <li><code>boxModel</code> is equal to true if the page is rendering according to the <a href="http://www.w3.org/TR/REC-CSS2/box.html">W3C CSS Box Model</a> (is currently false in IE 6 and 7 when they are in Quirks Mode). This property is null until document ready occurs.</li> |
32 |
| - <li><code>changeBubbles</code> is equal to true if the change event bubbles up the DOM tree, as required by the <a href="http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-eventgroupings-htmlevents">W3C DOM event model</a>. (It is currently false in IE, and jQuery simulates bubbling).</li> |
33 |
| - <li><code>checkClone</code> is equal to true if a browser correctly clones the checked state of radio buttons or checkboxes in document fragments.</li> |
34 |
| - <li><code>checkOn</code> is equal to true if the value of a checkbox defaults to "on" when no value is specified.</li> |
35 |
| - <li><code>cors</code> is equal to true if a browser can create an <code>XMLHttpRequest</code> object and if that <code>XMLHttpRequest</code> object has a <code>withCredentials</code> property. To enable cross-domain requests in environments that do not support cors yet but do allow cross-domain <abbr title="XMLHttpRequest">XHR</abbr> requests (windows gadget, etc), set <code>$.support.cors = true;</code>. |
36 |
| - <a href="http://www.w3.org/TR/cors/">CORS WD</a></li> |
37 |
| - <li><code>cssFloat</code> is equal to true if the name of the property containing the CSS float value is .cssFloat, as defined in the <a href="http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSS2Properties-cssFloat">CSS Spec</a>. (It is currently false in IE, it uses styleFloat instead).</li> |
38 |
| - <li><code>hrefNormalized</code> is equal to true if the <code>.getAttribute()</code> method retrieves the <code>href</code> attribute of elements unchanged, rather than normalizing it to a fully-qualified URL. (It is currently false in IE, the URLs are normalized). |
39 |
| - <div><a href="http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-666EE0F9">DOM l3 spec</a></div></li> |
40 |
| - <li><code>htmlSerialize</code> is equal to true if the browser is able to serialize/insert <code><link></code> elements using the <code>.innerHTML</code> property of elements. (is currently false in IE). <div><a href="http://www.w3.org/TR/2008/WD-html5-20080610/serializing.html#html-fragment">HTML5 WD</a></div></li> |
41 |
| - <li><code>leadingWhitespace</code> is equal to true if the browser inserts content with .innerHTML exactly as provided—specifically, if leading whitespace characters are preserved. (It is currently false in IE 6-8). <div><a href="http://www.w3.org/TR/2008/WD-html5-20080610/dom.html#innerhtml0">HTML5 WD</a></div></li> |
42 |
| - <li><code>noCloneChecked</code> is equal to true if cloned DOM elements copy over the state of the <code>.checked</code> expando. (It is currently false in IE). (Added in jQuery 1.5.1)</li> |
43 |
| - <li><code>noCloneEvent</code> is equal to true if cloned DOM elements are created without event handlers (that is, if the event handlers on the source element are not cloned). (It is currently false in IE). <div><a href="http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-Registration-interfaces-h3">DOM l2 spec</a></div></li> |
44 |
| - <li><code>opacity</code> is equal to true if a browser can properly interpret the opacity style property. (It is currently false in IE, it uses alpha filters instead). <div><a href="http://www.w3.org/TR/css3-color/#transparency">CSS3 spec</a></div></li> |
45 |
| - <li><code>optDisabled</code> is equal to true if option elements within disabled select elements are not automatically marked as disabled. <div><a href="http://dev.w3.org/html5/spec/the-button-element.html#attr-option-disabled">HTML5 WD</a></div></li> |
46 |
| - <li><code>optSelected</code> is equal to true if an <code><option></code> element that is selected by default has a working <code>selected</code> property. <div><a href="http://dev.w3.org/html5/spec/the-button-element.html#attr-option-selected">HTML5 WD</a></div></li> |
47 |
| - <li><code>scriptEval()</code> is equal to true if inline scripts are automatically evaluated and executed when inserted into the document using standard DOM manipulation methods such as <code>.appendChild()</code> and <code>.createTextNode()</code>. (It is currently false in IE, it uses <code>.text</code> to insert executable scripts). |
48 |
| - <div><strong>Note: No longer supported; removed in jQuery 1.6. Prior to jQuery 1.5.1</strong>, the <code>scriptEval()</code> method was the static <code>scriptEval</code> property. The change to a method allowed the test to be deferred until first use to prevent content security policy inline-script violations. </div> |
49 |
| - <div><a href="http://www.w3.org/TR/2008/WD-html5-20080610/tabular.html#script">HTML5 WD</a></div></li> |
50 |
| - <li><code>style</code> is equal to true if inline styles for an element can be accessed through the DOM attribute called style, as required by the DOM Level 2 specification. In this case, <code>.getAttribute('style')</code> can retrieve this value; in Internet Explorer, <code>.cssText</code> is used for this purpose. <div><a href="http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-ElementCSSInlineStyle">DOM l2 Style spec</a></div></li> |
51 |
| - <li><code>submitBubbles</code> is equal to true if the submit event bubbles up the DOM tree, as required by the <a href="http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-eventgroupings-htmlevents">W3C DOM event model</a>. (It is currently false in IE, and jQuery simulates bubbling).</li> |
52 |
| - <li><code>tbody</code> is equal to true if an empty <code><table></code> element can exist without a <code><tbody></code> element. According to the HTML specification, this sub-element is optional, so the property should be true in a fully-compliant browser. If false, we must account for the possibility of the browser injecting <code><tbody></code> tags implicitly. (It is currently false in IE, which automatically inserts <code>tbody</code> if it is not present in a string assigned to <code>innerHTML</code>). <div><a href="http://dev.w3.org/html5/spec/Overview.html#the-table-element">HTML5 spec</a></div></li> |
53 |
| - </ul> |
54 |
| - </longdesc> |
55 |
| - <example> |
56 |
| - <desc>Returns the box model for the iframe.</desc> |
57 |
| - <code><![CDATA[ |
58 |
| -$( "p" ).html( "This frame uses the W3C box model: <span>" + |
59 |
| - jQuery.support.boxModel + "</span>"); |
60 |
| -]]></code> |
61 |
| - <css><![CDATA[ |
62 |
| - p { |
63 |
| - color: blue; |
64 |
| - margin: 20px; |
65 |
| - } |
66 |
| - span { |
67 |
| - color: red; |
68 |
| - } |
69 |
| -]]></css> |
70 |
| - <html><![CDATA[ |
71 |
| -<p></p> |
72 |
| -]]></html> |
73 |
| - </example> |
74 |
| - <example> |
75 |
| - <desc>Returns false if the page is in QuirksMode in Internet Explorer</desc> |
76 |
| - <code><![CDATA[ |
77 |
| -jQuery.support.boxModel |
78 |
| -]]></code> |
79 |
| - <results><![CDATA[ |
80 |
| -false |
81 |
| -]]></results> |
82 |
| - </example> |
| 7 | + <desc>A collection of properties that represent the presence of different browser features or bugs. Intended for jQuery's internal use; specific properties may be removed when they are no longer needed internally to improve page startup performance. For your own project's feature-detection needs, we strongly recommend the use of an external library such as <a href="http://modernizr.com">Modernizr</a> instead of dependency on properties in <code>jQuery.support</code>.</desc> |
83 | 8 | <category slug="properties/global-jquery-object-properties"/>
|
84 | 9 | <category slug="utilities"/>
|
85 | 10 | <category slug="version/1.3"/>
|
|
0 commit comments