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?
(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)
Press Control+Shift+P or Command+Shift+P (Mac) to open the Command Menu. Start typing javascript , select Disable JavaScript, and then press Enter to run the command. JavaScript is now disabled.
When you click Call the function button, it will execute the function. To stop the function, click Stop the function execution button.
JavaScript Errors and generic handling. throw new Error('something went wrong') — will create an instance of an Error in JavaScript and stop the execution of your script, unless you do something with the Error.
Yes, it can be done. This will end execution of the javascript.
throw new Error('');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With