jQuery Plugin To Detect Browser Based On User Agent Browser Detection - Download jQuery Plugin To Detect Browser Based On User Agent - Browser Detection

Download jQuery Plugin To Detect Browser Based On User Agent – Browser Detection

Posted on

This time I will share jQuery Plugin and tutorial about jQuery Plugin To Detect Browser Based On User Agent – Browser Detection, hope it will help you in programming stack.

jQuery Plugin To Detect Browser Based On User Agent Browser Detection - Download jQuery Plugin To Detect Browser Based On User Agent - Browser Detection
File Size: 39.6 KB
Views Total: 2366
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

Browser Detection is a very small jQuery browser detection plugin which detects the browser based on user agent and allows you to do something when the user is using a specific browser.

Basic usage:

1. Include jQuery library and the jQuery browser detection plugin on your web page.

1 <script src="jquery-1.11.3.min.js"></script>
2 <script src="jquery.browser.detection.min.js"></script>

2. Detect the current browser and store the returned value in a variable.

1 var currentBrowser = $.browserDetection(true);

3. Do something according to the browser version.

1 switch(currentBrowser) {
2     case("IE9"):
3     console.log("Up<a href="https://www.jqueryscript.net/time-clock/">date</a> your browser, please!");
4     break;
5     ...
6 };

4. Apply different CSS rules for each browser.

01 .IE {
02   ...
03 }
04 .Chrome {
05   ...
06 }
07 .Safari {
08   ...
09 }
10 .Firefox {
11   ...
12 }
13 .Opera {
14   ...
15 }

Change log:

2015-10-23

  • fixed Chrome iOS detection

This awesome jQuery plugin is developed by danieledesantis. For more Advanced Usages, please check the demo page or visit the official website.

source : jqueryscript.net