In jquery, the $.browser
object can be used to get the name and version information of the browser, such as $.browser.chrome
true, the current Chrome browser, $.browser.mozilla
is true, the current Firefox browser, but also through the $.browser.version
way to get browser version information.
<body> <div id= "Divtest" > <div class= "title" > <span class= "FL" > Get browser Name and version number < ;/span> </div> <div class= "content" ></div> </div> <script type= "Text/ja Vascript "> $(function () { varstrtmp = "Your browser name is:"; if($.browser.chrome) {//Google ChromeStrtmp + = "Chrome"; } if($.browser.mozilla) {//Firefox-related browsersStrtmp + = "Mozilla FireFox"; } strtmp+ = "<br/><br/> Version number is:"//Get version number+$.browser.version; $(". Content"). HTML (strtmp); }); </script></body>
JQuery Tool class functions-browser information