获取当前页面网址代码

大策 发布于 2019-04-06 + 75 次浏览 + 0 条评论

ECshop文章页获取当前页面地址修改:

 注明:此代码如果放到goods.dwt或者article.dwt,查看源代码,并不是网址,而是以下代码。

ECSHOP获取当前页面地址,最新可用:http://zhaoshance.cn/wangzhanpeizhi/337.html

自己修改二:

 

<!-- 获取当前页面网址 -->
本文链接:
<a href="">

<script language="javascript">
thisURL = document.URL;
thisHREF = document.location.href;
thisSLoc = self.location.href;
thisDLoc = document.location;

document.write( strwrite );
</script>

<script language="javascript">
thisTLoc = top.location.href;
thisPLoc = parent.document.location;
thisTHost = top.location.hostname;
thisHost = location.hostname;
strwrite = "<tr><td valign=top>   </td><td>" + thisTLoc + "</td></tr>"

document.write( strwrite );
</script><br /><br />

</a>

{$article.title|escape:html}手机端链接:


<script language="javascript">
tmpHPage = thisHREF.split( "/" );
thisHPage = tmpHPage[ tmpHPage.length-1 ];
tmpUPage = thisURL.split( "/" );
thisUPage = tmpUPage[ tmpUPage.length-1 ];
strwrite = "<tr><td valign=top>  </td><td> http://" + thisTHost + "/moble/" + thisHPage + "</td></tr>"


document.write( strwrite );
</script>

 

 

 

自己修改一:

 


<script language="javascript">
thisURL = document.URL;
thisHREF = document.location.href;
thisSLoc = self.location.href;
thisDLoc = document.location;

document.write( strwrite );
</script>

<script language="javascript">
thisTLoc = top.location.href;
thisPLoc = parent.document.location;
thisTHost = top.location.hostname;
thisHost = location.hostname;
strwrite = "<tr><td valign=top>本文链接: </td><td>" + thisTLoc + "</td></tr>"

document.write( strwrite );
</script>

<script language="javascript">
tmpHPage = thisHREF.split( "/" );
thisHPage = tmpHPage[ tmpHPage.length-1 ];
tmpUPage = thisURL.split( "/" );
thisUPage = tmpUPage[ tmpUPage.length-1 ];
strwrite = "<tr><td valign=top>手机端链接: </td><td> http://" + thisTHost + "/moble/" + thisHPage + "</td></tr>"


document.write( strwrite );
</script>

 

 

 

网友分享,原始代码:

 <table width=100% cellpadding=0 cellspacing=0 border=0 >
<script language="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 );
</script>
thisDLoc = document.location; <BR>
thisURL = document.URL; <BR>
thisHREF = document.location.href; <BR>
thisSLoc = self.location.href;<BR>
<script language="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 );
</script>
thisTLoc = top.location.href; <BR>
thisPLoc = parent.document.location; <BR>
thisTHost = top.location.hostname; <BR>
thisHost = location.hostname;<BR>
<script language="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 );
</script><tr><td>

 

分类: 网站配置   本文标签:

除非注明,文章均为本站原创!转载请保留本文链接: http://zhaoshance.cn/wangzhanpeizhi/334.html


你应该会对下面的内容感兴趣:
  • 修改Emlog默认链接?post的方法

  • ECSHOP商品页/文章页获取当前页面网址方法【2019最新可用,调用的是伪静态地址不是动态地址】

  • 刷新本页面的按钮代码

  • index.asp文件301域名重定向至index.php

  • ECSHOP手机站绑定二级域名图片不显示解决办法

  • 用手机访问网站跳转至淘宝app、新浪app、抖音app或其他垃圾网站原因

  • 屏蔽鼠标左键选定和右键

获取当前页面网址代码:等您坐沙发呢!

发表评论



22 + 62 =



------====== 本站公告 ======------
 有事您QQ我:14331195                         扫描下面二维码,关注我的微信公众号 扫描公众号,关注我!

标签云