跪求大神帮我这段代码增加一下延迟跳转,拜托了
<script language="javascript">function dogo(){
var urls = new Array();
urls="http://www.baidu.com";
urls="http://www.52pojie.cn";
urls="http://www.qq.com";
urls="http://www.360.com";
urls="http://www.sogou.com";
n = Math.floor(Math.random()*5);
location.href= urls;
}
</script>
<body onload="javascript:dogo();">
</body> 老哥最好你得发到悬赏区, setTimeout(function(){
location.href= urls;
}, 1000);
浮华情未言 发表于 2020-7-30 14:57
setTimeout(function(){
location.href= urls;
}, 1000);
加那个位置 <script language="javascript">
function dogo(){
var urls = new Array();
urls="http://www.baidu.com";
urls="http://www.52pojie.cn";
urls="http://www.qq.com";
urls="http://www.360.com";
urls="http://www.sogou.com";
n = Math.floor(Math.random()*5);
setTimeout(function(){
location.href= urls;
}, 1000);
}
</script>
<body>
</body>
要是我没理解错的话 var urls = new Array();
urls="http://www.baidu.com";
urls="http://www.52pojie.cn";
urls="http://www.qq.com";
urls="http://www.360.com";
urls="http://www.sogou.com";
n = Math.floor(Math.random()*5);
setInterval('location.href= urls;', 3000); <script language="javascript">
function dogo(){
var urls = new Array();
urls="http://www.baidu.com";
urls="http://www.52pojie.cn";
urls="http://www.qq.com";
urls="http://www.360.com";
urls="http://www.sogou.com";
n = Math.floor(Math.random()*5);
// 1000是延迟时间,单位ms
setInterval(function(){
location.href= urls;
}, 1000);
}
</script> 浮华情未言 发表于 2020-7-30 14:58
function dogo(){
var urls = new Array();
urls="http://www.baidu.com";
没跳转了 爱了爱了 noooobugs 发表于 2020-7-30 15:08
function dogo(){
var urls = new Array();
urls="http://www.baidu.com";
可以了,谢谢
页:
[1]
2