Skip to content

Commit a7ddd36

Browse files
committed
jQuery.browser. Make abundantly clear that jQuery.browser is removed as of jQuery 1.9.
Closes #283
1 parent ec4a022 commit a7ddd36

2 files changed

Lines changed: 12 additions & 35 deletions

File tree

categories.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,9 @@
227227
<desc><![CDATA[These properties are associated with the global jQuery object.]]></desc>
228228
</category>
229229
</category>
230+
<category name="Removed" slug="removed">
231+
<desc></desc>
232+
</category>
230233
<category name="Selectors" slug="selectors">
231234
<desc><![CDATA[
232235
<p>Borrowing from CSS 1&#x2013;3, and then adding its own, jQuery offers a powerful set of tools for matching a set of elements in a document.</p>

entries/jQuery.browser.xml

Lines changed: 9 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<signature>
66
<added>1.0</added>
77
</signature>
8-
<desc>Contains flags for the useragent, read from navigator.userAgent. <strong>We recommend against using this property; please try to use feature detection instead (see jQuery.support). jQuery.browser may be moved to a plugin in a future release of jQuery.</strong> </desc>
8+
<desc>Contains flags for the useragent, read from navigator.userAgent. <strong>This property was removed in jQuery 1.9</strong> and is available only through the jQuery.migrate plugin. Please try to use feature detection instead.</desc>
99
<longdesc>
1010
<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>
1111
<p>Available flags are:</p>
@@ -29,36 +29,17 @@ jQuery.each(jQuery.browser, function(i, val) {
2929
});]]></code>
3030
</example>
3131
<example>
32-
<desc>Returns true if the current useragent is some version of Microsoft's Internet Explorer.</desc>
32+
<desc>Return true if the current useragent is some version of Microsoft's Internet Explorer. <strong>Will not work in jQuery 1.9 or later</strong> unless the <a href="https://github.com/jquery/jquery-migrate/#readme">jQuery Migrate</a> plugin is included.</desc>
3333
<code><![CDATA[
3434
$.browser.msie;
3535
]]></code>
3636
</example>
3737
<example>
38-
<desc>Alerts "this is WebKit!" only for WebKit browsers</desc>
38+
<desc>Alert "this is WebKit!" only for WebKit browsers. <strong>Will not work in jQuery 1.9 or later</strong> unless the <a href="https://github.com/jquery/jquery-migrate/#readme">jQuery Migrate</a> plugin is included.</desc>
3939
<code><![CDATA[
4040
if ($.browser.webkit) {
4141
alert( "this is webkit!" );
4242
}
43-
]]></code>
44-
</example>
45-
<example>
46-
<desc>Alerts "Do stuff for Firefox 3" only for Firefox 3 browsers.</desc>
47-
<code><![CDATA[
48-
var ua = $.browser;
49-
if ( ua.mozilla && ua.version.slice(0,3) == "1.9" ) {
50-
alert( "Do stuff for firefox 3" );
51-
}
52-
]]></code>
53-
</example>
54-
<example>
55-
<desc>Set a CSS property that's specific to a particular browser.</desc>
56-
<code><![CDATA[
57-
if ( $.browser.msie ) {
58-
$("#div ul li").css( "display","inline" );
59-
} else {
60-
$("#div ul li").css( "display","inline-table" );
61-
}
6243
]]></code>
6344
</example>
6445
<category slug="properties/global-jquery-object-properties"/>
@@ -71,7 +52,7 @@ jQuery.each(jQuery.browser, function(i, val) {
7152
<signature>
7253
<added>1.1.3</added>
7354
</signature>
74-
<desc>The version number of the rendering engine for the user's browser.</desc>
55+
<desc>The version number of the rendering engine for the user's browser. <strong>This property was removed in jQuery 1.9</strong> and is available only through the jQuery.migrate plugin.</desc>
7556
<longdesc>
7657
<p>Here are some typical results:</p>
7758
<ul>
@@ -83,32 +64,25 @@ jQuery.each(jQuery.browser, function(i, val) {
8364
<p>Note that IE8 claims to be 7 in Compatibility View.</p>
8465
</longdesc>
8566
<example>
86-
<desc>Returns the version number of the rendering engine used by the user's current browser. For example, FireFox 4 returns 2.0 (the version of the Gecko rendering engine it utilizes).</desc>
67+
<desc>Return the version number of the rendering engine used by the user's current browser. For example, FireFox 4 returns 2.0 (the version of the Gecko rendering engine it utilizes). <strong>Will not work in jQuery 1.9 or later</strong> unless the <a href="https://github.com/jquery/jquery-migrate/#readme">jQuery Migrate</a> plugin is included.</desc>
8768
<code><![CDATA[
88-
$("p").html( "The version number of the rendering engine your browser uses is: <span>" +
69+
$("p").html( "The version # of the browser's rendering engine is: <span>" +
8970
$.browser.version + "</span>" );
9071
]]></code>
9172
</example>
9273
<example>
93-
<desc>Alerts the version of IE's rendering engine that is being used:</desc>
74+
<desc>Alert the version of IE's rendering engine that is being used. <strong>Will not work in jQuery 1.9 or later</strong> unless the <a href="https://github.com/jquery/jquery-migrate/#readme">jQuery Migrate</a> plugin is included.</desc>
9475
<code><![CDATA[
9576
if ( $.browser.msie ) {
9677
alert( $.browser.version );
9778
}
98-
]]></code>
99-
</example>
100-
<example>
101-
<desc>Often you only care about the "major number," the whole number, which you can get by using JavaScript's built-in <code>parseInt()</code> function:</desc>
102-
<code><![CDATA[
103-
if ( $.browser.msie ) {
104-
alert( parseInt($.browser.version, 10) );
105-
}
10679
]]></code>
10780
</example>
10881
<category slug="properties/global-jquery-object-properties"/>
10982
<category slug="utilities"/>
11083
<category slug="version/1.0"/>
11184
<category slug="version/1.1.3"/>
112-
<category slug="deprecated/deprecated-1.3"/>
85+
<category slug="deprecated/deprecated-1.3"/>
86+
<category slug="removed"/>
11387
</entry>
11488
</entries>

0 commit comments

Comments
 (0)