本文內容很簡單,跟大家總結一下javascript取得目前的資訊的一些常用指令
console.info("document.URL=" document.URL);
console.info("document.location.href=" document.location.href);
//console.info("document.base=" document.base); //這是錯的!
console.info("document.location=" document.location);
console.info("self.location.href=" self.location.href);
console.info("top.location.href=" top.location.href);
console.info("location.hostname=" location.hostname);
console.info("window.location.host=" window.location.host);
console.info("window.location.pathname=" window.location.pathname);
暫時想起來的就這些啦,後續再更新^_^