html 获取当前域名,js获得当前url,javascript获取当前页面url值,js获取域名

傷城~ 2022-10-05 09:56 511阅读 0赞

thisURL = document.URL;

thisHREF = document.location.href;

thisSLoc = self.location.href;

thisDLoc = document.location;

strwrite = “

thisURL:[“ + thisURL + “]“

strwrite += “

thisHREF:[“ + thisHREF + “]“

strwrite += “

thisSLoc:[“ + thisSLoc + “]“

strwrite += “

thisDLoc:[“ + thisDLoc + “]“

document.write( strwrite );

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;

strwrite = “

thisTLoc:[“ + thisTLoc + “]“

strwrite += “

thisPLoc:[“ + thisPLoc + “]“

strwrite += “

thisTHost:[“ + thisTHost + “]“

strwrite += “

thisHost:[“ + thisHost + “]“

document.write( strwrite );

thisTLoc = top.location.href;

thisPLoc = parent.document.location;

thisTHost = top.location.hostname;

thisHost = location.hostname;

tmpHPage = thisHREF.split( “/“ );

thisHPage = tmpHPage[ tmpHPage.length-1 ];

tmpUPage = thisURL.split( “/“ );

thisUPage = tmpUPage[ tmpUPage.length-1 ];

strwrite = “

thisHPage:[“ + thisHPage + “]“

strwrite += “

thisUPage:[“ + thisUPage + “]“

document.write( strwrite );

发表评论

表情:
评论列表 (有 0 条评论,511人围观)

还没有评论,来说两句吧...

相关阅读

    相关 js获取当前页面URL

    在很多场景中我们需要在某个界面(不能确定的界面)跳转到另一个界面进行某项操作,然后操作完毕之后重新跳转到之前的页面(如浏览商品的过程中进行登录,登录后返回到浏览商品的界面),因