views:

210

answers:

4

Is it possible with Firebug to stop a javascript with a press of a button or a keyboard shortcut instead of stopping it by setting a breakpoint?

Why would I like to do this? We have a very dynamic website with lots of animations. It would be a great help if I could just stop the scripts at the moment the animation is doing something I want to inspect. That would be a lot faster than fiddling with the breakpoints.

+1  A: 

From what you describe, I'm guessing javascript console logging from your code might help you best. Check out http://getfirebug.com/wiki/index.php/Console_API.

psychotik
A: 

There is a pause button in firebug. Clicking on that is what you are looking for.

Kasturi
The pause button that's labeled "break on all errors?" That's not how that works.
matt lohkamp
+1  A: 

depending on the animation library you're using, there might be a 'stop all animations' method - jQuery's .stop(), for instance. how are you handling the animations?

matt lohkamp
A: 

If you know where it's doing something you want to inspect, then what is wrong with breakpoints? Also, you can use the debugger keyword in the code, or you can inject console.log/debug/warn/info statements in your code. (You can stub out the console object for those environments that don't have one).

Tracker1