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

本篇文章主要是对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的示例代码的详细内容,更多请关注0133技术站其它相关文章!

赞(0) 打赏
未经允许不得转载:0133技术站首页 » JavaScript 教程