日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 编程资源 > 编程问答 >内容正文

编程问答

navigator对象介绍

發(fā)布時(shí)間:2024/4/14 编程问答 37 豆豆
生活随笔 收集整理的這篇文章主要介紹了 navigator对象介绍 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
<html> <head><title> 測(cè)試navigator對(duì)象 </title> <body><script>document.write("navigator.appName="+navigator.appName);document.write("<br>");document.write("parseFloat(navigator.appVersion)="+parseFloat(navigator.appVersion));document.write("<br>appVersion屬性返回一串包含比版本號(hào)更多的信息字符,但現(xiàn)在我們只要版本號(hào)。要從字符串中提出版本號(hào)我們使用一個(gè)叫parseFloat()的函數(shù)來(lái)返回?cái)?shù)字。");document.write("navigator.appVersion="+parseFloat(navigator.appVersion));document.write("<br>");document.write("navigator 對(duì)象的屬性:"+"</br>"); document.write("appcodename:"+navigator.appCodeName+"<br>") document.write("appname::"+navigator.appName+"<br>") document.write("appversion:"+navigator.appVersion+"<br>") document.write("platform:"+navigator.platform+"<br>") document.write("userAgent:"+navigator.userAgent+"<br>") document.write("navigator對(duì)象的方法"+"<br>") document.write("1.javaEnabled():"+navigator.javaEnabled()+"</br>") if(navigator.appName.indexOf("Microsoft")!=-1){ document.write("用戶瀏覽器是微軟的IE瀏覽器"+"<br>")} else if(navigator.appName.indexOf("Netscape")!=-1){ document.write("用戶瀏覽器是netscape的netscape瀏覽器"+"<br>")} if(navigator.appVersion.indexOf("4.0")!=-1){ document.write("this browser is not 4.0 compliant.<br>") } else{ document.write("you are using a version 4.0compatible browser")} document.write("location對(duì)象的屬性"+"<br>") document.write("1.hash"+location.hash+"<br>") document.write("2.hostname"+location.hostname+"<br>") document.write("3.host"+location.host+"<br>") document.write("4.href:"+location.href+"<br>") document.write("5.port:"+location.port+"<br>") document.write("6.search"+location.search+"<br>")</script> </body> </html>

?

結(jié)果:

navigator.appName=Microsoft Internet Explorer
parseFloat(navigator.appVersion)=4
appVersion屬性返回一串包含比版本號(hào)更多的信息字符,但現(xiàn)在我們只要版本號(hào)。要從字符串中提出版本號(hào)我們使用一個(gè)叫parseFloat()的函數(shù)來(lái)返回?cái)?shù)字。navigator.appVersion=4
navigator 對(duì)象的屬性:
appcodename:Mozilla
appname::Microsoft Internet Explorer
appversion:4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET4.0C; .NET4.0E; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
platform:Win32
userAgent:Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET4.0C; .NET4.0E; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
navigator對(duì)象的方法
1.javaEnabled():true
用戶瀏覽器是微軟的IE瀏覽器
this browser is not 4.0 compliant.
location對(duì)象的屬性
1.hash
2.hostname
3.host
4.href:file:///C:/Documents%20and%20Settings/Administrator/桌面/openHTML.html
5.port:
6.search

總結(jié)

以上是生活随笔為你收集整理的navigator对象介绍的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。