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>
本文为原创文章,版权归主机之家测评所有,欢迎分享本文,转载请保留出处!
内容反馈