开发者

How to debug javascript program [duplicate]

This question already has answers here: How can I debug my JavaScript code? [closed] (20 answers) Closed 6 years ago.

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();
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜