userAgent 屬性是一個只讀的字符串,聲明了瀏覽器用于 HTTP 請求的用戶代理頭的值。
一般來講,它是在 navigator.appCodeName 的值之后加上斜線和 navigator.appVersion 的值構(gòu)成的。
例如:Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; .NET CLR 1.1.4322)。
注:用戶代理頭:user-agent header。
navigator.userAgent
<html>
<body>
<script type="text/javascript">
document.write("<p>UserAgent: ")
document.write(navigator.userAgent
+ "</p>")
</script>
</body>
</html>
如對本文有疑問,請?zhí)峤坏浇涣髡搲?,廣大熱心網(wǎng)友會為你解答??! 點擊進入論壇
Powered by 365建站網(wǎng) RSS地圖 HTML地圖
copyright © 2013-2024 版權(quán)所有 鄂ICP備17013400號