navigator,Location常用

Navigator对象(即浏览器对象,提供浏览器相关的信息 )
打印浏览器相关信息 
e.g.
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>");

——————————————————————————

document.write("协议 location.protocol:"+location.protocol);
document.write("主机名 location.hostname:"+location.hostname);
document.write("端口号 (默认是80,没有即表示80端口)location.port:"+location.port);
document.write("主机加端口号 location.host:"+location.host);
document.write("访问的路径  location.pathname:"+location.pathname);
document.write("锚点 location.hash:"+location.hash);
document.write("参数列表 location.search"+location.search);

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值