jqueryexithalt

JAVASCRIPT equivalent of exit


Pretty simple question, but much to my surprise I could not find an answer on the internets.

In PHP we have exit; which will simply stops executing any further code when it reaches that line, assuming there are no errors.

Does jQuery (JAVASCRIPT for all yous) have a similar built in function? This is to be used for debugging, not for production.

Thanks!


Solution

  • window.stop() (vanilla JavaScript, not jQuery) would simulate the user clicking the Stop button on the browser, preventing the browser from downloading and rendering the current page.