How to debug javascript program [duplicate]
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.
Venkman JavaScript Debugger
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.
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.
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 :-)
Chrome has some very nice developer tools as well.
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();
精彩评论