Window-Navigator对象

25 篇文章 0 订阅
6 篇文章 0 订阅

包含有关浏览器的信息

注意: 没有应用于 navigator 对象的公开标准,不过所有浏览器都支持该对象。

 1. appCodeName

一个只读字符串,声明了浏览器的代码名

googleIEfirefoxsafariopera
truetruetruetruetrue

`navigator.appCodeName`

document.write("浏览器代号: " + navigator.appCodeName);

 2. appName

可返回浏览器的名称

googleIEfirefoxsafariopera
truetruetruetruetrue

`navigator.appName`

document.write("浏览器名称: " + navigator.appName);

 3.appVersion

可返回浏览器的平台和版本信息。该属性是一个只读的字符串

googleIEfirefoxsafariopera
truetruetruetruetrue

`navigator.appVersion`

document.write("浏览器版本信息: " + navigator.appVersion);

 4.cookieEnabled

返回一个布尔值,如果浏览器启用了 cookie,该属性值为 true。如果禁用了 cookie,则值为 false

googleIEfirefoxsafariopera
truetruetruetruetrue

`navigator.cookieEnabled`

document.write("是否启用 Cookie: " + navigator.cookieEnabled);

 5.platform

只读的字符串,声明了运行浏览器的操作系统和(或)硬件平台

googleIEfirefoxsafariopera
truetruetruetruetrue

`navigator.platform`

document.write("硬件平台: " + navigator.platform);

 6.userAgent

只读的字符串,声明了浏览器用于 HTTP 请求的用户代理头的值

googleIEfirefoxsafariopera
truetruetruetruetrue

`navigator.userAgent`

document.write("用户代理: " + navigator.userAgent);

7. onLine

一个只读的布尔值,声明了系统是否处于脱机模式

 注释:在 IE 4+ 中,用户可以在浏览器中选择脱机工作的状态。当脱机工作被选后,系统就进入了脱机状态,内容将从缓存进行读取。

navigator.onLine

document.write(navigator.onLine)

1. javaEnabled

返回一个布尔值,该值指示浏览器是否支持并启用了 Java。如果是,则返回 true,否则返回 false。

googleIEfirefoxsafariopera
truetruetruetruetrue

navigator.javaEnabled()

document.write("启用Java: " + navigator.javaEnabled());

文档内容出自 W3cSchool和菜鸟教程,
如需查看更详细的有关内容 请登录 http://www.w3school.com.cn/http://www.runoob.com/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值