<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd "> <ptml xmlns=" http://www.w3.org/1999/xhtml "> <pead> <meta content=" text/html; Charset=utf-8 "http-equiv=" content-type/> <title>javascript detects browser type and version number (compatible with browsers) </title> <script language= "JavaScript" type= "Text/javascript" > var uA = navigator.useragent; var browsertype = "Unknown"; if (Ua.indexof ("opera") >-1) {BrowserType = "opera"; else if (Ua.indexof ("Safari") >-1) {BrowserType = "safari"; else if (Ua.indexof ("Konqueror") >-1) {BrowserType = "Konqueror"; else if (Ua.indexof ("Gecko") >-1) {BrowserType = "Mozilla"; else if (Ua.indexof ("MSIE") >-1) {BrowserType = "Internet Explorer"; }//window.alert (BrowserType); document.write (BrowserType); document.write (""); document.write (document.lastmodified); Displays the modified date of the page document.write (""); document.write (navigator.useragent);Display Client Environment Parameters document.write (""); document.write ("H,w:" +screen.availheight+ "x" +screen.availwidth+ "Pixels")//monitor size/monitor size function Screenwh () { var Getscreen=document.getelementbyid (' Screenwh '); getscreen.value=screen.availheight+ "X" +screen.availwidth; var Divscreen=document.getelementbyid (' Screenswh '); divscreen.value=screen.availheight+ "x" +screen.availwidth+ "Pixels"; window.screen.height+ "+" +window.screen.width; } </script> </pead> <body onload= "JAVASCRIPT:SCREENWH ();" > <input type= "text" id= "Screenwh"/> <input ' button ' type= ' onclick= () ' Notempty ' Form value= ' Checker <div id= "SCREENSWH" ></div> </body> </ptml>
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]
Related articles:
JavaScript detects browser types and versions of code
JavaScript Browser Detection Code Lite version
JavaScript determines browser type and version