if(id2==0){ var r=sc.getDat({ Fields:'top 1 id', Filter:'isc=1 and tid='+id1 +' order by sort, id desc', Table :'SC_Def' }); if(r.length){ id2=r[0].id; }else{ id2=id1; } } %>
 
 
 

您的当前位置:首页 > 网站学堂学习教程后台程序

分享到:
0

后台程序

学堂首页网站欣赏学习教程常用软件设计素材开源代码建站规范建站宝典学员交流

JS获取当前网址

添加时间:2011-10-28  点击次数:1462  【返回】

1.获取当前完整网址
<script type="text/javascript">
  
thisURL = document.URL;
thisHREF = document.location.href;
thisSLoc = self.location.href;
thisDLoc = document.location;
strwrite = " thisURL:  [" + thisURL + "]<br />"
strwrite += " thisHREF:  [" + thisHREF + "]<br />"
strwrite += " thisSLoc:  [" + thisSLoc + "]<br />"
strwrite += " thisDLoc:  [" + thisDLoc + "]<br />"
document.write( strwrite );
    </script>

2.获取当前域名信息
    <script type="text/javascript">

thisTLoc = top.location.href;
thisPLoc = parent.document.location;
thisTHost = top.location.hostname;
thisHost = location.hostname;
strwrite = "  thisTLoc:  [" + thisTLoc + "]<br />"
strwrite += " thisPLoc:  [" + thisPLoc + "]<br />"
strwrite += " thisTHost:  [" + thisTHost + "]<br />"
strwrite += " thisHost:  [" + thisHost + "]<br />"
document.write( strwrite ); 
    </script>

3.获取当前页面
<script type="text/javascript">
 
tmpHPage = thisHREF.split( "/" );
thisHPage = tmpHPage[ tmpHPage.length-1 ];
tmpUPage = thisURL.split( "/" );
thisUPage = tmpUPage[ tmpUPage.length-1 ];
strwrite = " thisHPage:  [" + thisHPage + "]<br />"
strwrite += " thisUPage:  [" + thisUPage + "]<br />"
document.write( strwrite );
    </script>

 

 

销售热线:0755-26430418,26435736, 售后服务:0755-26435726,86063568,  续费专线:0755-26435736,  E-mail:kf@510888.cn
Copyright © 2003-2021 深圳市赛奥特网络有限公司 All Rights Reserved. 备案序号:粤ICP备06028019号
网站建设网站运营网站推广,专业团队尽心尽力为客户做好每一个细节!  
深圳网站建设深圳网页设计深圳网站制作深圳建网站赛奥特网络网站建设网站推广域名注册虚拟主机企业邮箱网络营销电子商务网站制作网站设计网站服务企业网站企业信息化