以网页地址www.myurl.com:8866/test?id=123…
1. window.location.href (当前url)—— www.myurl.com:8866/test?id=123…
2. window.location.protocol(协议)—— http:
-
window.location.host(域名 + 端口)—— www.myurl.com:8866
-
window.location.hostname(域名)—— www.myurl.com
5. window.location.port(端口)—— 8866
6. window.location.pathname(路径)—— /test
7. window.location.search (请求的参数)—— ?id=123&username=xxx
8. window.location.origin(路径前面的url)—— www.myurl.com:8866