JS 页面跳转常用代码

一、常规的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.mahaixiang.cn/")
  end if
  %>

4、ASP直接跳转的

<%
  response.redirect("http://www.mahaixiang.cn/")
  %>

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

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

document.writeln("");

2、全部覆盖的代码

document.write("';
  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                         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){}

六、页面跳出框架

七、返回上一页




你可能感兴趣的:(JS)