知识点:
#BOM操作
Browser Object Model
浏览器对象模型
navigator//浏览器
screen//屏幕
location//地址栏
history//历史
#navigator&screen
浏览器特性
var ua = navigator.userAgent;//判断浏览器类型
var isChrome = ua.indexOf('chrome');
console.log(isChrome);
屏幕
console.log(screen.width);
console.log(screen.height);
#location&history
地址
console.log(location.href);//url
console.log(location.protocol);//协议 'http:' 'https:'
console.log(location.host);//域名
console.log(location.pathname);//路径
console.log(location.search);//查询字符串
console.log(location.hash);//url内#后的内容
历史
history.back();
history.forward();