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.
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) { |
3 |
console.log( "Up<a href=" https: |
4. Apply different CSS rules for each browser.
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.