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);