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
https://forums.phpfreaks.com/topic/155954-javascript-debugging-guide/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.