Javascript 广告弹出窗口Onclick延迟
我使用Javascript 广告弹出窗口Onclick延迟,javascript,popup,Javascript,Popup,我使用延迟属性,异步属性,设置超时函数做了很多测试。这里有一个来自Stack用户的测试方法: <script> setTimeout(function(){ var s = document.createElement('script'); s.src = 'http://example.com/some/script.js'; document.head.appendChild(s); }, 2000); </script> setTimeo
延迟属性
,异步属性
,设置超时函数
做了很多测试。这里有一个来自Stack用户的测试方法:
<script>
setTimeout(function(){
var s = document.createElement('script');
s.src = 'http://example.com/some/script.js';
document.head.appendChild(s);
}, 2000);
</script>
setTimeout(函数(){
var s=document.createElement('script');
s、 src='1〕http://example.com/some/script.js';
文件。标题。附录子项;
}, 2000);
但是没有成功
我的目标在理论上很简单:我有两个弹出代码,当用户点击Alertbox时开始。我需要在弹出窗口1上应用延迟,这是代码:
<script type="text/javascript" src="http://xxxx.xxxx.net/pop.js"></script>
一些可以帮助我的想法?不太确定你的要求,但也许setTimeout是你需要的 i、 e
setTimeout(yourPopupFunction(),);
不太确定您的要求,但可能需要设置超时
i、 e
setTimeout(yourPopupFunction(),);
我有测试设置超时,但不起作用。我也尝试了使用defer和asynch属性,但没有任何结果。我添加了一个用于测试延迟的方法。如果在.js文件加载附加到正文时弹出窗口正在运行,则标头应该适用于youdocument.body.appendChild,而不是document.head.appendChild?是(或document.getElementsByTagName('body')[0].appendChild)我有测试设置超时,但不工作。我也尝试了使用defer和asynch属性,但没有任何结果。我添加了一个用于测试延迟的方法。如果在.js文件加载附加到正文时弹出窗口正在运行,则标头应该适用于youdocument.body.appendChild,而不是document.head.appendChild?是(或document.getElementsByTagName('body')[0].appendChild)
setTimeout( yourPopupFunction(), <delay in ms>);