开发者

stop Javascript function with another Javascript call?

开发者 https://www.devze.com 2023-04-01 02:43 出处:网络
In the o开发者_高级运维riginal Javascript is there I want this to stop it setTimeout(\'open_popup()\',200);

In the o开发者_高级运维riginal Javascript is there I want this to stop it

setTimeout('open_popup()',  200);

What is function To stop this from another file js


setTimeout returns a handle that you can use the clear the timeout:

var timer = setTimeout(open_popup,  200);

clearTimeout(timer);

That of course assumes you put the timer variable in a scope that is accessible to both scripts and that you clear the timeout before it fires.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号