How do you debug Javascript applications?

后端 未结 3 475
滥情空心
滥情空心 2020-12-20 03:26

I work in an application that is JavaScript intense. So to debug , I end up using many alerts. Are there other better ways to debug ? What methods do you use ?

3条回答
  •  攒了一身酷
    2020-12-20 04:01

    Use Firefox as your main development platform and open the Web Console. Error messages are printed there.

    Chrome also has a console, but it doesn't have Firebug, a Firefox add-on used for web development. While the Web Console that comes with Firefox will display errors in Javascript, Firebug will also help with inspecting the HTML for your page, and there are even extensions to Firebug like Flashbug for working with Flash components on your page.

    Obviously you'll want to check your web apps in all browsers eventually, but do most of your developing in Firefox.

提交回复
热议问题