Programmatically stop JavaScript execution in Firebug

JavascriptDebuggingFirebugBreakpoints

Javascript Problem Overview


I am currently debugging complex JavaScript code with Firebug. I am looking for a way to stop the JavaScript execution as if it was a breakpoint programmatically.

Example:

instructions ...
degugger.breakpoint(); // the execution stops here as if a breakpoint was
                       // manually set
other instructions ...

Javascript Solutions


Solution 1 - Javascript

You can use the debugger statement:

// your JS code
...
// break here
debugger;

It works in all major browsers.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionNikkoView Question on Stackoverflow
Solution 1 - JavascriptRaYellView Answer on Stackoverflow