赞
踩
protocol 属性是一个可读可写的字符串,可设置或返回当前 URL 的协议。
例:http://localhost:3001/#/ 会返回 http:
console.log(document.location.protocol) //返回 http: 或者 https
host 属性是一个可读可写的字符串,可设置或返回当前 URL 的主机名称和端口号
语法:window.location.host
console.log(window.location.host)
例:http://localhost:3001/#/ 会返回 localhost:3001
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。