window.location.protocol 獲取http,http://請求協議頭
window.location.host 獲取域名並帶端口 xxx.com 如果有端口就是 xxx.com:8080
window.location.hostname; 獲取域名: xxx.com
window.location.href; 獲取整個url地址:http://xxx.com/xxx.html
window.location.pathname; 獲取域名后面請求路徑url: /xxx/xxx.html
window.location.port 獲取端口比如 8080