How to Detect Client Browser in JQuery


If you want to present or implement something based on the client browser, you can detect client browser in JQuery using jQuery.browser property.

if ($.browser.webkit) {
   alert("this is webkit!");
}
else if ($.browser.safari) {
   alert("this is safari!");
}
else if ($.browser.opera) {
   alert("this is opera!");
}
else if ($.browser.msie) {
   alert("this is IE!");
}
else if ($.browser.mozilla) {
   alert("this is FireFox!");
}

 

 

About author


User avatar

Waqas Anwar

Founder of EzzyLearning.com, Senior Consultant, Microsoft .NET and Web Technologies

Comments