标签:name user utf-8 lang 系统 pes 协议 document appcode
浏览器对象在浏览器打开时自动创建,内部封装了有关客户机浏览器的信息。
appName:返回浏览器的名称
appVersion:返回浏览器的平台和版本信息
appCodeName:浏览器所使用的核心程序的名称
userAgent:用户代理,这个信息会放在HTTP协议的头部发给网页服务器
mimiTypes:一个数组,包含的是浏览器所支持的所以MIME类型
cookieEnabled:返回指明浏览器中是否启用cookie的布尔值
platform:返回运行浏览器的操作系统平台。
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<h1>以下是浏览器信息</h1>
<script language="javascript">
    for(var attr in navigator) {
        document.write(attr);
        document.write("==");
        document.write(navigator[attr]);
        document.write("<br />");
    }
</script>
</body>
</html>
标签:name user utf-8 lang 系统 pes 协议 document appcode
原文地址:https://www.cnblogs.com/rjbc/p/11679482.html