[HTML] 纯文本查看 复制代码
<html>
<body>
<script type="text/javascript">
var browser=navigator.appName
var b_version=navigator.appVersion
var version=parseFloat(b_version)
document.write("浏览器名称:"+ browser)
document.write("<br />")
document.write("浏览器版本:"+ version)
</script>
</body>
</html>结果:浏览器名称:Netscape
浏览器版本:5检测浏览器的更多信息使用 JavaScript 检测关于访问者浏览器的更多信息。代码部分:<html>
<body>
<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>")
</script>
</body>
</html>
[HTML] 纯文本查看 复制代码
<html>
<body>
<script type="text/javascript">
var x = navigator;
document.write("CodeName=" + x.appCodeName);
document.write("<br />");
document.write("MinorVersion=" + x.appMinorVersion);
document.write("<br />");
document.write("Name=" + x.appName);
document.write("<br />");
document.write("Version=" + x.appVersion);
document.write("<br />");
document.write("CookieEnabled=" + x.cookieEnabled);
document.write("<br />");
document.write("CPUClass=" + x.cpuClass);
document.write("<br />");
document.write("OnLine=" + x.onLine);
document.write("<br />");
document.write("Platform=" + x.platform);
document.write("<br />");
document.write("UA=" + x.userAgent);
document.write("<br />");
document.write("BrowserLanguage=" + x.browserLanguage);
document.write("<br />");
document.write("SystemLanguage=" + x.systemLanguage);
document.write("<br />");
document.write("UserLanguage=" + x.userLanguage);
</script>
</body>
</html>
[HTML] 纯文本查看 复制代码
<html>
<head>
<script type="text/javascript">
function detectBrowser()
{
var browser=navigator.appName
var b_version=navigator.appVersion
var version=parseFloat(b_version)
if ((browser=="Netscape"||browser=="Microsoft Internet Explorer") && (version>=4))
{alert("您的浏览器够先进了!")}
else
{alert("是时候升级您的浏览器了!")}
}
</script>
</head>
<body>
</body>
</html>