Here's what a typical breakpoint looks like in Firebug:
Then, when the page is reloaded, if your breakpoints are triggered, Firebug will pause script execution and transfer the control to you.
In most cases, the method above is the only method of setting breakpoints you will ever need to use.
If you have access to the source, the solution comes in the form of the
More so, this method also works in Google Chrome and IE (if you have Microsoft Script Debugger). Here is a screenshot of my Chrome Beta 4.0.266.0 triggering:
I consider this feature relatively unpublished and therefore awesome because:
- it's hard to search for this specific meaning of the keyword "debugger" when Firebug itself is a debugger and it's a very popular word
- nobody really reads documentation for Firebug, and even if they do, I haven't actually seen the debugger keyword mentioned
- I didn't know about it until recently, even though I've been using Firebug for years
And finally, don't forget to remove any traces of 'debugger' from your code when you go live or your users will rightfully hunt you down.
Credits And References:
- suggested by a co-worker from Plaxo – Russ. Thanks Russ!
- some more interesting info at StackOverflow and Infragistics.
In the meantime, if you found this article useful, feel free to buy me a cup of coffee below.