我们经常需要获取网页的url,此时就会用到如下:
document.location.protocol //判断是 https: 还是http:document.location.hostname //获取是 localhost 还是192.168.100.118 还是document.location.port //获取端口号 8080 等
以备以后使用
时间:2018-12-10 14:59:53
我们经常需要获取网页的url,此时就会用到如下:
document.location.protocol //判断是 https: 还是http:document.location.hostname //获取是 localhost 还是192.168.100.118 还是document.location.port //获取端口号 8080 等
以备以后使用