js与uri中location关系

//获取域名
host = window.location.host;
host2=document.domain; 

//获取页面完整地址
url = window.location.href;

document.write("<br>host="+host)
document.write("<br>host2="+host2)
document.write("<br>url="+url)

 

总结 获取所有跟uri有关的 都在window.location属性中

你可能感兴趣的:(location)