The use of the jQuery library is increasing at a fast pace . More and more people are using this useful javascript library nowadays.
This page targets towards discussion of useful tips, tricks and solutions provided by jQuery. Hope the jQuery lovers finds it useful and also contributes towards making it a success.
To start with here is a sample jQuery code snippet which can be used to detect browsers. $(document).ready(function() {
// Target anything above IE6
if ($.browser.msie && $.browser.version > 6){ // do something }
// Target Firefox 2 and above
if ($.browser.mozilla && $.browser.version >= “1.8″ ){ // do something }
// Target Safari
if( $.browser.safari ){ // do something }
// Target Chrome if( $.browser.chrome){ // do something }
// Target Opera if( $.browser.opera){ // do something } });
Note: As of jQuery 1.4, the $.browser variable is replaced by $.support
Source: http://www.opensourcehunter.com/
This page targets towards discussion of useful tips, tricks and solutions provided by jQuery. Hope the jQuery lovers finds it useful and also contributes towards making it a success.
To start with here is a sample jQuery code snippet which can be used to detect browsers. $(document).ready(function() {
// Target anything above IE6
if ($.browser.msie && $.browser.version > 6){ // do something }
// Target Firefox 2 and above
if ($.browser.mozilla && $.browser.version >= “1.8″ ){ // do something }
// Target Safari
if( $.browser.safari ){ // do something }
// Target Chrome if( $.browser.chrome){ // do something }
// Target Opera if( $.browser.opera){ // do something } });
Note: As of jQuery 1.4, the $.browser variable is replaced by $.support
Source: http://www.opensourcehunter.com/
No comments:
Post a Comment