What is a good Javascript debugging tool?

后端 未结 16 756
渐次进展
渐次进展 2020-11-29 06:12

Haven\'t touch javascript for 3 years. Just got a javascript project and wanted to know any new ways or tools emerged these years to debug javascript? I used alert 3 years

相关标签:
16条回答
  • 2020-11-29 06:28

    I realize I'm answering a question you didn't ask, but have you tried jQuery? It's a javascript library that abstracts a lot of the DOM manipulation stuff for you so you don't have to worry so much about cross-browser compatibility issues. There are other similar libraries out there, but I believe jQuery has the biggest following at the moment. http://jquery.com/

    I use Firebug in Firefox every day. In addition to debugging Javascript (and by extension, jQuery or any other js library), it's a great for CSS debugging.

    0 讨论(0)
  • 2020-11-29 06:29

    Dreamweaver as I write it and Firebug for more indepth debugging. alert()s are pretty useful too.

    0 讨论(0)
  • 2020-11-29 06:30

    Aptana is a great dev platform that allows you to debug both FireFox and IE.

    0 讨论(0)
  • 2020-11-29 06:31

    If you use Visual Studio, I highly recommend debugging with IE, despite what others say. When you hit a debugger statement in IE and you have debugging enabled, you'll get a pop-up to start debugging in Visual Studio.

    I don't like Firebug anymore, I don't know where it went wrong, but it's become highly unreliable (ignoring debugger statements) and really can't compete with VS as far as debugging is concerned.

    0 讨论(0)
  • 2020-11-29 06:34

    I argue to use build-in browser debugger for performance reason. Firefox and Chrome one are good enough.

    They allow browse DOM, show dynamically generated sources, show network activity, profile JS, etc.

    But don't miss printf-approach with:

    console.log("this is %o, event is %o, host is %s", this, e, location.host);
    

    and:

    console.log("%s", new Error().stack);
    
    0 讨论(0)
  • 2020-11-29 06:35

    Use the Firebug extension for Firefox, or the built-in Web Inspector in any WebKit browser (Chrome or Safari). In IE8, you can use the built-in Developer ToolS.

    0 讨论(0)
提交回复
热议问题