Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

jQuery.browser property

jQuery.browser property

jQuery Miscellaneous MethodsjQuery Miscellaneous Methods

Example

Display browser information:

$(function () {

    $.each( $.browser, function( i, val ) {

        $( "

" + i + " : " + val + "" )

        .appendTo( document.body );

    });

})

Try it »


Definition and Usage

The $.browser property was removed in jQuery 1.9. It was used to return information about the browser currently used by the user.

It is not recommended to use this property to detect the browser, because it determines browser information based on the navigator.userAgent property, so its identification is not necessarily accurate.


Syntax

$

.browser

Parameters Description
webkit Boolean type: indicates whether it is a WebKit-based browser.
safari Boolean type: indicates whether it is the Apple Safari browser.
opera Boolean type: indicates whether it is the Opera browser.
msie Boolean type: indicates whether it is the Microsoft IE browser.
mozilla Boolean type: indicates whether it is the Mozilla Firefox browser.
chrome Boolean type: indicates whether it is the Google Chrome browser.
version String type: the version number of the current browser, for example: "6.0", "7.0".

More examples

Using the IE browser
Indicates that the current browser is IE.

Using a WebKit-based browser
Indicates that the current browser is WebKit-based.

Browser version number
Return the version number of the current browser.

IE browser version number
Return the version number of the IE browser.


jQuery Miscellaneous MethodsjQuery Miscellaneous Methods