Stop executing all javascript

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

(NOTE: I cannot use breakpoints in the debugger, because the error is in ie8, and the debugger does not allow you to scroll up and down the page, while at the breakpoint, to see at what point the error occurs. I need to scroll the page during the stop code)

+5
source share
3 answers

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

No.

This is all that can be said, really.

+3
source

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

throw new Error('');

+5
debugger;

( , )

+1

All Articles