document.location.host //表示当前域名 + 端口号
document.location.hostname //表示域名
document.location.href //表示完整的URL
document.location.port //表示端口号
document.location.protocol //表示当前的网络协议
document.location.protocol //表示当前的网络协议可以解决一些和协议相关的问题(http的请求在https下不安全之类的)