我有一个这样的脚本:
<div id="my_div"></div>
<script>
setTimeout(
function myFunction() {
$('#my_div').load('example1.php');
document.getElementById("header").innerHTML = "EXAMPLE 1";
setInterval(function() {
$('#my_div').load('example1.php');
document.getElementById("header").innerHTML = "EXAMPLE 1";
}, 8000)
}, 0);
setTimeout(
function myFunction1() {
$('#my_div').load('example2.php');
document.getElementById("header").innerHTML = "EXAMPLE 2";
setInterval(function() {
$('#my_div').load('example2.php');
document.getElementById("header").innerHTML = "EXAMPLE 2";
}, 8000)
}, 4000);
</script>
它应该每4秒加载一次页面(0s,4s,8s,12s,16s,20s,24s,28s,32s等)。但是当我执行脚本时,setInterval
将在30秒后重置。我认为有默认设置,但如何更改此设置?
谢谢