views:

73

answers:

3

I want to step through a javascript as it happens, but skipping the steps where the functions are in jQuery.

Is there any way this can be done?

+1  A: 

Yes, use breakpoints.

Nico
how do i set a breakpoint if i am using firefox
ming yeow
either with firebug or from vs08/10 js debugging frame
Nico
+2  A: 

You can use Step Over when you are debugging. Step Over will simply go to the next line of code without going into the called method. This will make sure you don't go into jQuery method.

What you have probably been using is Step Into which goes to the next line of code that will be executed. This makes you go into the jQuery method when you are debugging.

In both Google Chrome and Firefox (with Firebug), the button Step Over and Step Into are right next to each other, just make sure you press the right one.

HoLyVieR
@HoLyVieR : +1, I must confess I am still using console.log() to print out debugging messages :(
Michael Mao
@Michael Doing alert() and console.log() is a valid way to debug stuff. In some situation, it's faster to debug with console.log() and in other situation step by step debugging is faster to debug with. You don't have to confess it :p
HoLyVieR
what is the easiest way to set a breakpoint and for it to happen in firefox?
ming yeow
@ming If you want to add a breakpoint in your code you need to install Firebug first. After that in the Script panel, you can click on the line number you want the code to stop at and it will add a breakpoint.
HoLyVieR
Got it - so i need to do it in the firebug script panel, as opposed to doing it in the code. thanks! =D
ming yeow
+2  A: 

Using Firebug javascript trace you can "step over" function calls with F10, and "step out" of a function body with the proper icon, in case you accidentally entered a jQuery function.

Sebastián Grignoli