Debugger; keyword

From FirebugWiki

Revision as of 14:02, 13 April 2011 by Sebastianz (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

To stop script execution at a specific line inside your code you can use the debugger; keyword. As soon as this line is reached, the execution is halted, Firebug switches to the Script Panel and a break notification is shown. Break notifications can be disabled by unchecking the "Show Break Notifications" option inside the Script Panel's Options Mini Menu.

Example:

 function test(variable) {
   for(var i=0; i<10; i++) {
     if(i == 5)
       debugger;
   }
 }

Personal tools