Примеры для jQuery.browser


Show the browser info.

1
2
3
4
jQuery.each( jQuery.browser, function( i, val ) {
$( "<div>" + i + " : <span>" + val + "</span>" )
.appendTo( document.body );
});

Return true if the current useragent is some version of Microsoft's Internet Explorer. Will not work in jQuery 1.9 or later unless the jQuery Migrate plugin is included.

1
$.browser.msie;

Alert "this is WebKit!" only for WebKit browsers. Will not work in jQuery 1.9 or later unless the jQuery Migrate plugin is included.

1
2
3
if ( $.browser.webkit ) {
alert( "This is WebKit!" );
}

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). Will not work in jQuery 1.9 or later unless the jQuery Migrate plugin is included.

1
2
$( "p" ).html( "The version # of the browser's rendering engine is: <span>" +
$.browser.version + "</span>" );

Alert the version of IE's rendering engine that is being used. Will not work in jQuery 1.9 or later unless the jQuery Migrate plugin is included.

1
2
3
if ( $.browser.msie ) {
alert( $.browser.version );
}