开发者

Stopping all javascript execution

开发者 https://www.devze.com 2023-02-28 02:24 出处:网络
Is there an equiva开发者_如何学Clent to the php die() function for javascript that stops all javascript (including future callbacks for ajax requests, timeouts etc...) from running?

Is there an equiva开发者_如何学Clent to the php die() function for javascript that stops all javascript (including future callbacks for ajax requests, timeouts etc...) from running?

(NOTE: I can't use breakpoints in the debugger as the bug is in ie8 and the debugger prevents you from scrolling up/down the page while at a breakpoint; to be able to see at which point the bug is occurring I need to be able to scroll the page while the code is stopped)


Yes, it can be done. This will end execution of the javascript.

throw new Error('');


Is there an equivalent to the php die() function for javascript that stops all javascript (including future callbacks for ajax requests, timeouts etc...) from running?

No.

That's all there is to say, really.


debugger;

in console to pause execution (at least in chrome)

0

精彩评论

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