1
我想使这个代码运行20秒后的setTimeout:SetTimeout如何做到这一点?
<script type="text/javascript">
soundcloud.addEventListener('onPlayerReady', function(player, data) {
player.api_play();
});
</script>
代码正常单独,但我不知道如何来延迟它。我该怎么做?
感谢
这可能是OP想要的,我不认为他们具体询问他们想要什么。另外,根据[MDC](https://developer.mozilla.org/en/window.setTimeout)*请注意,在第一种语法中向函数传递附加参数在Internet Explorer中无效。*是否有任何理由在这里做,即内部函数不能访问其父'玩家'(或星期五毁了我的大脑)? – alex 2011-04-29 04:47:22
你是对的@alex,我更新了我的回复。 – CarlosZ 2011-04-29 05:09:14
+1最有可能做OP的要求,并高兴我的大脑仍然OK :) – alex 2011-04-29 05:12:37