javascript獲得當(dāng)前的信息的一些常用命令

字號(hào):


    這篇文章主要介紹了javascript獲得當(dāng)前的信息的一些常用命令,需要的朋友可以參考下
    本文內(nèi)容很簡(jiǎn)單,給大家總結(jié)一下javascript獲得當(dāng)前的信息的一些常用命令
    console.info("document.URL=" + document.URL);
    console.info("document.location.href=" + document.location.href);
    //console.info("document.base=" + document.base); //這是錯(cuò)的!
    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);
    暫時(shí)想起來(lái)的就這些啦,后續(xù)再更新^_^