js获取当前地址 JS获取当前URL的示例代码

复制代码 代码如下:



thisDLoc = document.location;

thisURL = document.URL;

thisHREF = document.location.href;

thisSLoc = self.location.href;


thisTLoc = top.location.href;

thisPLoc = parent.document.location;

thisTHost = top.location.hostname;

thisHost = location.hostname;


你可能感兴趣的:(js获取当前地址 JS获取当前URL的示例代码)