方法1:- <meta http-equiv="refresh" content="3;URL=https://tuyuanma.com/">
复制代码 方法2:- <script type="text/javascript">
- window.onload=function(){
- setTimeout(go, 3000);
- };
- function go(){
- location.href="https://tuyuanma.com/";
- }
- </script>
复制代码 方法3:- <script type="text/javascript">
- onload=function(){
- setInterval(go, 1000);
- };
- var x=3; //利用了全局变量来执行
- function go(){
- x--;
- if(x>0){
- document.body.innerhtml=x; //每次设置的x的值都不一样了。
- }else{
- location.href="https://tuyuanma.com/";
- }
- }
- </script>
复制代码 |