3

I can't find great way to debug javascript. I know firebug on firefox, but it's not best way I think. I want to put break point and trace program but I can't with it. Do you know good tool or how to trace the program.

Shunter1112
  • 623
  • 1
  • 8
  • 17
  • 9
    You can put break point and trace in Firebug. – Fopfong Jun 18 '10 at 07:20
  • 2
    Firebug facilitates everything you've just listed. Under the script toolbar, you can add breakpoints and step through your program. Also, inside your code, throwing things into console.log is extremely helpful. – Jamie Wong Jun 18 '10 at 07:22
  • 5
    You could have searched stackoverflow: http://stackoverflow.com/questions/988363/how-do-you-debug-your-javascript-code http://stackoverflow.com/questions/1739221/what-is-a-good-javascript-debugging-tool and several others, in fact. – Greg S Jun 18 '10 at 07:24

6 Answers6

1

Venkman JavaScript Debugger

T.T.T.
  • 29,703
  • 45
  • 120
  • 161
1

Firebug Extension for Firefox (Yes, it also supports breakpoints) or the Webkit Inspector that's built into Safari and Chrome by default.

Both offer JavaScript debugging/profiling and a lot of other useful features.

selfawaresoup
  • 14,267
  • 7
  • 32
  • 45
1

I believe this is what you're looking for:
http://weblogs.asp.net/scottgu/archive/2007/07/19/vs-2008-javascript-debugging.aspx

N.S.

Jonathan Pitre
  • 2,197
  • 3
  • 20
  • 35
0

I find IE 8 Developer Tools (built into IE 8) and Visual Studio (2008, Express is free) are an excellent way to debug JavaScript -- at least in an environment compatible with the above tools :-)

  • considering, that IE8 is ... IE8 and that VS is rather heavy (ok, maybe not for most ppl out there), and also that IE + VS is basically solution for Win OS only (we don't know which one OP is working on) - this solution is not a good choice. I have IE8 and VS2010, but I can't live without firebug extension, when it comes to web dev (OP simply couldn't find the right tools) – Soul Reaver Jun 22 '11 at 20:42
  • Seriously, I'm not sure why I got a down-vote. Please read the full answer **"at least in an environment compatible with the above tools"** -- in which case, my answer is as good as any, *even if you are a Firefox/Firebug supporter*. –  Jun 23 '11 at 05:14
  • it's not mine down-vote. I know that your answer **is** a solution, but not for everyone (what probably is the reason behind this down-vote) – Soul Reaver Jun 23 '11 at 07:31
0

Add the snippet debugger; in your javascript code that will allow you to debug on the browser console

function myFunction(){
        //Some stuff
        debugger;  //Debugging is automatically started from here
        //Some stuff
    }
    myFunction();
Rolwin Crasta
  • 3,951
  • 3
  • 29
  • 44
0

Chrome has some very nice developer tools as well.

jwerre
  • 7,971
  • 6
  • 50
  • 63