麻豆小视频在线观看_中文黄色一级片_久久久成人精品_成片免费观看视频大全_午夜精品久久久久久久99热浪潮_成人一区二区三区四区

首頁 > 開發 > JS > 正文

JS判斷瀏覽器之Navigator對象

2024-09-06 12:43:37
字體:
來源:轉載
供稿:網友
The Navigator Object
導航對象
The JavaScript Navigator object contains all information about the visitor's browser. We are going to look at two properties of the Navigator object:
JS導航對象包含所有有關訪問這者瀏覽器的信息。我們將看看兩個導航對象的產物:

appName -  holds the name of the browser
appName - 含瀏覽器的名稱 
appVersion - holds, among other things, the version of the browser
appVersion - 瀏覽器版本 
Example
舉例 

[Ctrl+A 全選 注:如需引入外部Js需刷新才能執行]
The variable browser in the example above holds the name of the browser, i.e. "Netscape" or "Microsoft Internet Explorer".
上面例子中變量brower(瀏覽器)被賦加了瀏覽器的名稱,網景或是IE(或其他)

The appVersion property in the example above returns a string that contains much more information than just the version number, but for now we are only interested in the version number. To pull the version number out of the string we are using a function called parseFloat(), which pulls the first thing that looks like a decimal number out of a string and returns it.
上面例子中的appVersion屬性返回一串包含比版本號更多的信息字符,但現在我們只要版本號。要從字符串中提出版本號我們使用一個叫parseFloat()的函數來返回數字。

IMPORTANT! The version number is WRONG in IE 5.0 or later! Microsoft start the appVersion string with the numbers 4.0. in IE 5.0 and IE 6.0!!! Why did they do that??? However, JavaScript is the same in IE6, IE5 and IE4, so for most scripts it is ok.
(有關JS返回IE版本號的問題)

Example
舉例
The script below displays a different alert, depending on the visitor's browser:
根據訪問者的瀏覽器,(不同的瀏覽器)下面的腳本將顯示不同的警示:
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 美国一级黄色毛片 | 国产精品久久久久久久久久10秀 | 免费国产一区二区视频 | 日韩黄色片免费看 | 欧美精品一区二区三区四区 | 欧美城网站地址 | 欧美成人一级 | 一级做受毛片免费大片 | 日韩视频一二三 | 一级黄色片在线看 | 欧美精品成人一区二区三区四区 | 视频一区二区在线播放 | 欧美一级特黄aaaaaaa什 | 国产青草视频在线观看 | 国产成人在线观看免费 | 亚欧在线免费观看 | 小视频免费在线观看 | 久久久久久久亚洲视频 | 久久精品国产精品亚洲 | 精品人成| 午夜小视频免费观看 | 日韩视频不卡 | 国产精品hd免费观看 | 一级做a爱性色毛片免费1 | 九九午夜 | 精品国产成人 | 国产精品亚洲激情 | 久草在线播放视频 | 日韩视频一 | 草草视频在线播放 | 黄色免费在线网址 | 深夜影院a | 久久久久久久久久久一区 | 黄色a级片免费观看 | 欧美xxxx精品另类 | 一级在线| 国产精品视频2021 | 高清做爰免费无遮网站挡 | 片在线观看 | 国产高潮失禁喷水爽到抽搐视频 | 国产毛片毛片 |