首页 > 代码库 > navigator对象

navigator对象

 1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 2 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
 3 <head>
 4     <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
 5     <title>浏览器信息</title>
 6     <script>  
 7         var str = "浏览器名称:" + navigator.appName;
 8             str += "<br>版本号" + navigator.APPVersion;
 9             str += "<br>操作系统" + navigator.platform;
10             str += "<br>系统语言" + navigator.systemLanguage;
11             str += "<br>用户语言" + navigator.userLanguage;
12             document.write(str+"<hr>");
13 
14             if(navigator.appName == "Netscape"){
15                 document.write("窗口宽度:"+window.innerWidth+" 窗口高度:"+window.innerHeight);
16             }else {
17                 var width = document.documentElement.clientWidth;
18                 var height = document.documentElement.clientHeight;
19                 document.write("窗口宽度:"+width+" 窗口高度:"+height);
20             }
21     </script>
22 </head>
23 <body>
24     
25 </body>
26 </html>

 

navigator对象