我调用函数document.write()的加入联内容(横幅广告):我页面上document.write()的()覆盖所有页面
<body>
Page content start<br>
<script>
function postContent(){
document.write('added content');
}
postContent();
</script>
<br>Page content end
</body>
:
Page content start
added content
Page content end
我要添加这些内容有延迟,但里面的setTimeout()document.write()的覆盖所有的内容。
<body>
Page content start<br>
<script>
function postContent(){
document.write('added content');
}
setTimeout(function() {
postContent();
}, 3000);
</script>
<br>Page content end
</body>
3秒之内我:
added content
我如何可以调用函数document.write()的有延迟和不覆盖所有的页面?
注意:我无权访问插入广告横幅的功能。
你需要使用'document.write()的'本身? – DroidNoob
insertAdjacentHtml呢? – funcoding
完全加载HTML文档后使用document.write()将删除所有现有的HTML。 – CaptainHere