国内外VPS
主机测评与优惠

js跳转页面的方法大全

js跳转页面的方法大全:

1.直接跳转到指定页面

  <script>    window.location.href="http://www.02405.com";  </script>

2.在新窗体中打开指定页面

  <script>    window.open("http://www.02405.com");  </script>

3.跳转到上一页(返回)

  <script>    window.history.back(-1);  </script>  

4.在框架(iframe)中跳转

  <script>    //在框架内(当前html页面)中跳转    self.location.href="http://www.02405.com";    //在框架外(顶层html页面)中跳转    top.location.href="http://www.02405.com";  </script>

5.延时跳转(倒计时跳转)

  <script>    var i = 5;//倒计时5秒钟    var timer = setInterval(function(){      i--;      if(i<=0){        window.location.href = "http://www.02405.com";      }    },1000);  </script>

赞(0)
版权声明:本文采用知识共享 署名4.0国际许可协议 [BY-NC-SA] 进行授权
文章名称:《js跳转页面的方法大全》
文章链接:https://www.liuzhanwu.com/3217.html
本站资源仅供个人学习交流,请于下载后24小时内删除,不允许用于商业用途,否则法律问题自行承担。

登录

找回密码

注册