navigator object
navigator object
appName: browser software name, mainly used to determine what core browser the customer is using.
- appVersion: The core version number of the browser software.
- systemLanguage: system language
- userLanguage: user language
- platform: platform
<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>php.cn</title> <script type="text/javascript"> //实例:测试不同浏览器 var str = "<h2>浏览器的相关信息</h2>"; str += "软件名称:"+navigator.appName; str += "<br>核心版本:"+navigator.appVersion; str += "<br>系统语言:"+navigator.systemLanguage; str += "<br>用户语言:"+navigator.userLanguage; str += "<br>用户平台:"+navigator.platform; document.write(str+"<hr>"); var width; var height; if(navigator.appName=="Netscape") { width = window.innerWidth; height = window.innerHeight; }else { width = document.documentElement.clientWidth; height = document.documentElement.clientHeight; } document.write("浏览器内宽:"+width+",浏览器内高:"+height); </script> </head> <body > </body> </html>