Navigator 瀏覽器對象,包含了正在使用的 Navigator 的版本信息。反映了當前使用的瀏覽器的資料。JavaScript 客戶端運行時刻引擎自動創建 navigator 對象。
          更詳細的信息可以去查msdn或者Navigator 2.0以后的說明文檔,這里我們之做個簡單的說明
          包括一下幾大屬性:

          • appCodeName 返回瀏覽器的“碼名”(?),流行的 IE 和 NN 都返回 'Mozilla'。
            下面的例子顯示了 appCodeName 屬性的值:
            document.write("navigator.appCodeName 的值是" + navigator.appCodeName)
          • appName 返回瀏覽器名。IE 返回 'Microsoft Internet Explorer',NN 返回 'Netscape'。
            下面的例子顯示了 appName 屬性的值:
            document.write("navigator.appName 的值是 " + navigator.appName)
          • appVersion 返回瀏覽器版本,包括了大版本號、小版本號、語言、操作平臺等信息。
          • language 語言
          • mimeType 以數組表示所支持的MIME類型
          • platform 返回瀏覽器的操作平臺,對于 Windows 9x 上的瀏覽器,返回 'Win32'(大小寫可能有差異)。
          • userAgent 返回以上全部信息。例如,IE5.01 返回 'Mozilla/4.0 (compatible; MSIE 5.01; Windows 98)'。
          • plugins 以數組表示已安裝的外掛程序
          • javaEnabled() 返回一個布爾值,代表當前瀏覽器允許不允許 Java。

          檢測瀏覽器的版本、所支持的MIME類型、已安裝的外掛程序(plug-in)。該對象包含兩個子對象:外掛對象、MIME類型對象。
          例如:

          <Script>
          with (document) {
               write (
          "你的瀏覽器信息:<OL>");
               write (
          "<LI>代碼:"+navigator.appCodeName);
               write (
          "<LI>名稱:"+navigator.appName);
               write (
          "<LI>版本:"+navigator.appVersion);
               write (
          "<LI>語言:"+navigator.language);
               write (
          "<LI>編譯平臺:"+navigator.platform);
               write (
          "<LI>用戶表頭:"+navigator.userAgent);
          }

          </Script>


          例如:

          <Script>
          if (document.all) {
              document.write(
          "你的瀏覽器是:MSIE");
          }
              else {
              document.write(
          "你的瀏覽器是:Navigator");
          }

          </Script> 

          Screen
          基本JavaScript的Screen屏幕對象

          • screen 屏幕對象 反映了當前用戶的屏幕設置。
          • width 返回屏幕的寬度(像素數)。
          • height 返回屏幕的高度。
          • availWidth 返回屏幕的可用寬度(除去了一些不自動隱藏的類似任務欄的東西所占用的寬度)。
          • availHeight 返回屏幕的可用高度。
          • colorDepth 返回當前顏色設置所用的位數 - 1:黑白;8:256色;16:增強色;24/32:真彩色


            下面是英文的Navigator瀏覽器的屏幕對象:

          • availHeight:minus permanent or semipermanent user interface features displayed by the operating system:such as the Taskbar on Windows.  
          • availWidth:Specifies the width of the screen, in pixels, minus permanent or semipermanent user interface:features displayed by the operating system, such as the Taskbar on Windows.  
          • colorDepth:The bit depth of the color palette, if one is in use; otherwise, the value is derived from screen.pixelDepth.  
          • height:Display screen height.  
          • pixelDepth:Display screen color resolution (bits per pixel).  
          • width:Display screen width.

          History
          JavaScript中的History歷史對象包含了用戶已瀏覽的 URL 的信息,是指歷史對象指瀏覽器的瀏覽歷史。鑒于安全性的需要,該對象收到很多限制,現在只剩下下列屬性和方法。History歷史對象有length這個屬性,列出歷史的項數。JavaScript 所能管到的歷史被限制在用瀏覽器的“前進”“后退”鍵可以去到的范圍。本屬性返回的是“前進”和“后退”兩個按鍵之下包含的地址數的和。

          History歷史對象并有以下方法

          • back() 后退,跟按下“后退”鍵是等效的。
          • forward() 前進,跟按下“前進”鍵是等效的。
          • go() 用法:history.go(x);在歷史的范圍內去到指定的一個地址。如果 x < 0,則后退 x 個地址,如果 x > 0,則前進 x 個地址,如果 x == 0,則刷新現在打開的網頁。history.go(0) 跟 location.reload() 是等效的。


          posted on 2007-12-03 18:43 湘江夜游神 閱讀(505) 評論(0)  編輯  收藏 所屬分類: JavaScript

          Locations of visitors to this page

          主站蜘蛛池模板: 龙海市| 江孜县| 昌吉市| 高青县| 禄劝| 洛浦县| 德化县| 南宁市| 涞水县| 东乡县| 札达县| 长海县| 文成县| 茂名市| 枝江市| 皋兰县| 霸州市| 漳州市| 敖汉旗| 遵化市| 昭通市| 屏边| 定州市| 洛扎县| 抚州市| 文安县| 射洪县| 阜新市| 安新县| 汉寿县| 宝坻区| 胶州市| 达日县| 金湖县| 冕宁县| 唐海县| 龙口市| 孝感市| 江门市| 湄潭县| 师宗县|