function reload(){
alert("ce");
}
window.onload=function(){
alert("a");
setInterval("reload()",1000);
document.write("aaa");
};
As above, there is no problem in other fast browsers and chrome kernel browsers with setInterval and document.write at the same time. But in IE11 browser, setInterval will stop. How to deal with it. Thanks.
PHP中文网2017-07-05 10:50:22
document.write will implicitly call document.open. This will reconstruct the document, removing all event events and task.
You can use document.body.innerText instead of document.write
function reload(){
alert("ce");
}
window.onload=function(){
alert("a");
setInterval("reload()",1000);
document.body.innerText = "aaa";
};