<html>
<head>
<title>Navigator对象属性</title>
</head>
<body>
<h2>Navigator对象属性</h2>
<hr>
<script language="JavaScript">
var objnav = window.navigator;
document.write("appCodeName= " + objnav.appCodeName + "<br>");
document.write("appMinorVersion= " + objnav.appMinorVersion + "<br>");
document.write("appName= " + objnav.appName + "<br>");
document.write("appVersion= " + objnav.appVersion + "<br>");
document.write("browserLanguage= " + objnav.browserLanguage + "<br>");
document.write("cookieEnabled= " + objnav.cookieEnabled + "<br>");
document.write("cpuClass= " + objnav.cpuClass + "<br>");
document.write("onLine= " + objnav.onLine + "<br>");
document.write("platform= " + objnav.platform + "<br>");
document.write("systemLanguage= " + objnav.systemLanguage + "<br>");
document.write("userAgent= " + objnav.userAgent + "<br>");
document.write("userLanguage= " + objnav.userLanguage + "<br>");
</script>
</body>
</html>

解决方案 »

  1.   

    <?xml version="1.0" encoding="BIG5"?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
              "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
      <title> ex541.1.htm </title> 
      <style>
        input {behavior:url(#default#clientCaps)}
      </style>
      <script language="vbs">
       function button1_onclick()
            str1= button1.colordepth    
            str2= button1.connectionType    
            str3= button1.cpuClass    
            str4= button1.height    
            str5= button1.width    
            str6= button1.platform    
            str7= button1.SystemLanguage    
            str8= button1.UserLanguage                
            document.open
               document.write "<pre style='font-size:18'>"
               document.writeln " colordepth    = " & str1 
               document.writeln " connectionType= " & str2 
               document.writeln " cpuClass      = " & str3 
               document.writeln " height        = " & str4 
               document.writeln " width         = " & str5 
               document.writeln " platform      = " & str6 
               document.writeln " SystemLanguage= " & str7 
               document.writeln " UserLanguage  = " & str8               
            document.write "</pre>"
        end function
      </script>
    </head>
    <body>
      <input type="button" id="button1" value="click here" >
    </body>
    </html>