Navigator userAgent 属性

定义和用法
userAgent 属性是一个只读的字符串,声明了浏览器用于 HTTP 请求的用户代理头的值。
语法
navigator.userAgent
浏览器支持
所有主要浏览器都支持 userAgent 属性
实例
实例
您的浏览器发送的用户代理标题:
<script>
document.write("用户代理: " + navigator.userAgent);
</script>
document.write("用户代理: " + navigator.userAgent);
</script>
以上实例输出结果:
尝试一下 »

更多实例
