您的位置:首页 > Web前端 > JavaScript

JS获取浏览器信息

2009-04-17 13:50 169 查看
<html>
<body>
<mce:script type="text/javascript"><!--
document.write("<p>浏览器:")
document.write(navigator.appName + "</p>")

document.write("<p>浏览器版本:")
document.write(navigator.appVersion + "</p>")

document.write("<p>代码:")
document.write(navigator.appCodeName + "</p>")

document.write("<p>平台:")
document.write(navigator.platform + "</p>")

document.write("<p>Cookies 启用:")
document.write(navigator.cookieEnabled + "</p>")

document.write("<p>浏览器的用户代理报头:")
document.write(navigator.userAgent + "</p>")
// --></mce:script>
</body>
</html>


 

 

本机运行结果:

浏览器:Microsoft Internet Explorer

浏览器版本:4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; QQDownload 1.7; InfoPath.2; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30)

代码:Mozilla

平台:Win32

Cookies 启用:true

浏览器的用户代理报头:Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; QQDownload 1.7; InfoPath.2; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30)

 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息