Jump to content

JavaScript Debugging - Guide.


wrathican

Recommended Posts

I write this in the hope that it will help a few people out there.

 

There are many ways in which to debug JavaScript. Some involve websites, and some involve browsers.

The best way I have found to debug Javascript is to use Mozilla Firefox with the FireBug add-on. If you are a developer and do not have these, then you are doing something wrong. FireBug provides excellent JS debugging, HTTP Request monitoring and inline html editing, among other features. FireFox has the advantage of being cross-platform allowing any add-ons to be platform independent too. Using other browsers error/debugging tools just dont cut it for me. Stay away from the Internet Explorer JS debugging client. It is terrible, although since IE8 it has become more informative, but you cannot use the browser again until it's closed.

 

Another great way to debug JS and follow best practices is by pasting your script into JSLint. This provides a list of things wrong with your script.

 

If you use AJAX then use JSON. Please do NOT use eval. Eval is EVIL as JSLint will constantly remind you of! Use a JSON parser. Preferrably this one kindly provided from the people over at JSON.org

 

Please feel free to add your comments/debugging tips!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.