// location (地址栏对象信息)
//http://127.0.0.1:5500/04.location.html
console.log(window.location);
//host:域名和端口号
console.log(window.location.host);
//hostname:域名
console.log(window.location.hostname);
//href:完整的url地址
//给值就是设置不给值就是获取
console.log(window.location.href);
// 网页跳转
// window.location.href = "https://www.baidu.com";
// port 端口号
console.log(window.location.port); //5500
//protocol 协议
console.log(window.location.protocol); //http:
//pathname 路径地址
console.log(window.location.pathname); ///04.location.html
// http://127.0.0.1:5500/04.location.html?name=%E5%93%88%E5%93%88&age=100#heihie
//hash 哈希值 #..
console.log(window.location.hash); //#heihie
//search 获取通过?传递参数
console.log(window.location.search); //?name=%E5%93%88%E5%93%88&age=100