JS显示当前页面路径的代码
2009-07-25 14:26
591 查看
<mce:script type="text/javascript"><!-- thisURL = document.URL; thisHREF = document.location.href; thisSLoc = self.location.href; thisDLoc = document.location; strwrite = "<tr><td valign=top>thisURL: </td><td>[" + thisURL + "]</td></tr>" strwrite += "<tr><td valign=top>thisHREF: </td><td>[" + thisHREF + "]</td></tr>" strwrite += "<tr><td valign=top>thisSLoc: </td><td>[" + thisSLoc + "]</td></tr>" strwrite += "<tr><td valign=top>thisDLoc: </td><td>[" + thisDLoc + "]</td></tr>" document.write( strwrite ); // --></mce:script> <mce:script type="text/javascript"><!-- thisTLoc = top.location.href; thisPLoc = parent.document.location; thisTHost = top.location.hostname; thisHost = location.hostname; strwrite = "<tr><td valign=top>thisTLoc: </td><td>[" + thisTLoc + "]</td></tr>" strwrite += "<tr><td valign=top>thisPLoc: </td><td>[" + thisPLoc + "]</td></tr>" strwrite += "<tr><td valign=top>thisTHost: </td><td>[" + thisTHost + "]</td></tr>" strwrite += "<tr><td valign=top>thisHost: </td><td>[" + thisHost + "]</td></tr>" document.write( strwrite ); // --></mce:script> <mce:script type="text/javascript"><!-- tmpHPage = thisHREF.split( "/" ); thisHPage = tmpHPage[ tmpHPage.length-1 ]; tmpUPage = thisURL.split( "/" ); thisUPage = tmpUPage[ tmpUPage.length-1 ]; strwrite = "<tr><td valign=top>thisHPage: </td><td>[" + thisHPage + "]</td></tr>" strwrite += "<tr><td valign=top>thisUPage: </td><td>[" + thisUPage + "]</td></tr>" document.write( strwrite ); // --></mce:script>
相关文章推荐
- 用js实现页面显示当前日期和时间的代码
- 用js实现页面显示当前日期和时间的代码
- js在页面显示当前时间
- JS当前页面登录注册框,固定DIV,底层阴影的实例代码
- JavaScript页面实时显示当前时间实例代码
- 解决使用Vue.js显示数据的时,页面闪现原始代码
- JS在页面上显示当前日期和时间
- js 在当前页获取上级页面的路径
- 用js查找法实现当前栏目的高亮显示的代码
- 用js查找法实现当前栏目的高亮显示的代码
- js获取网页当前页面及路径
- js显示当前系统时间的代码
- JS获取当前页面跟路径,JS打开新标签页
- 当前页面js代码
- js获取当前路径的简单示例代码
- 一个坑爹的问题,js注释掉夹杂的el表达式页面不显示(代码颜色坑了我)
- 根据IP显示天气预报代码:只显示成一行,可在页面调用JS即可
- 一个可以显示当前年份以及生肖的js代码
- 使用js高亮菜单中属于当前页,显示网页路径,