var hostname = location.hostname;     //获取当前域名
var localurl = location.href;                  //获取当前的url地址信息