Tip Details Add a Related Tip

Rate as: Positive Negative

Debugging Javascript

If you've ever tried to debug Javascript you know how frustrating it can be. You've got the alert function you can call, but it's pretty brain-dead and if you pass it an Array or Object it can't show any of the content. Firefox offers some useful Javascript errors when they occur, and IE is just about useless in giving you any clue as to what's going on.

If you want to make your Javascript debugging a LOT easier, you need to get the Firebug plug-in for Firefox. While it does have some problems (it slows down pages and occasionally crashes), it makes debugging much, much easier. And you can turn Firebug on and off with a single click, so it's easy to turn on when you need it.

It gives you code profiling, timing, breakpoints, and all sorts of complicated functionality. But even if you are an old-school type who likes to print alerts, it makes that better too. Using the console logging (instead of alerts), you can print out the values and keys for arrays and objects. Even more powerfully, you can type javascript directly into the console and have it execute on the page. This allows you to do things like test out regular expressions and perform DOM manipulation directly on your page. Very simple to do, and very powerful. Your javascript development will be a lot faster and much less frustrating.
Link: addons.mozilla.org...Search for more tips related to this link
Rating: 100% positive, 1 Vote
Categories: programming javascript debugging firefox firebug
Added: on Sep 12, 2008 at 2:35 pm
Added By: an anonymous user
Searches: javascript debugging firefox firebug programming

Comments on this Tip

Add a Comment
There are no comments for this tip
Your Comment:
(how to format)
Rate This Tip:

Verify Humanity:
Sorry, we know it's annoying, but please enter the characters shown in the image to the left so that we know you're an actual person and not an evil spammer. Thanks.
       

Related Tips

console.log statements not working in Firebug

100% positive, 1 comment - last added on Jan 22, 2009 at 1:05 pm
– Tip added by an anonymous user on Jan 12, 2009 at 2:22 pm

Don't include a "length" attribute in a JSON Object

100% positive, 0 comments
– Tip added by an anonymous user on Apr 10, 2009 at 4:51 pm

Detecting if a variable exists in Javascript

100% positive, 2 comments - last added on Oct 21, 2009 at 2:29 pm
– Tip added by an anonymous user on Jul 22, 2008 at 8:31 am

Telling when an iframe is done loading

85% positive, 3 comments - last added on May 16, 2009 at 7:48 am
– Tip added by an anonymous user on Apr 18, 2008 at 8:05 am

jQuery ajax responseText empty

100% positive, 2 comments - last added on Aug 25, 2009 at 9:58 am
– Tip added by an anonymous user on Mar 27, 2009 at 8:26 am

Length of associative arrays in Javascript

100% positive, 0 comments
– Tip added by an anonymous user on Nov 04, 2008 at 10:13 am

Matching any character in a javascript regular expression

100% positive, 2 comments - last added on Oct 08, 2009 at 2:33 am
– Tip added by an anonymous user on Aug 18, 2008 at 9:06 am

reading select element values in javascript in IE7

100% positive, 0 comments
– Tip added by an anonymous user on Jul 17, 2009 at 1:28 pm

Unable to click in text input boxes on Internet Explorer

100% positive, 2 comments - last added on Aug 07, 2009 at 4:57 pm
– Tip added by Marcos84 on Dec 09, 2008 at 10:49 am

Optional parameters in javascript functions

100% positive, 0 comments
– Tip added by an anonymous user on Jul 30, 2008 at 10:44 am

Using optional parameter in javascript

Categories: javascript programming
100% positive, 0 comments
– Tip added by an anonymous user on Jul 17, 2008 at 7:49 am

Javascript Error: unterminated regular expression literal

50% positive, 0 comments
– Tip added by marty on Jun 26, 2008 at 1:20 pm

Keep websites from disabling right-click menus

100% positive, 0 comments
– Tip added by an anonymous user on Jan 20, 2009 at 8:08 am

Checking for undefined variables in Javascript

100% positive, 1 comment - last added on Jul 14, 2009 at 5:13 pm
– Tip added by an anonymous user on Jan 14, 2009 at 9:47 am

Viewing CSS and Javascript files

100% positive, 0 comments
– Tip added by an anonymous user on Aug 20, 2008 at 7:27 am

compressing javascript

100% positive, 0 comments
– Tip added by an anonymous user on Jun 12, 2008 at 3:02 pm

Viewing CSS and Javascript source in Firefox

Categories: firefox javascript CSS HTML
no ratings, 0 comments
– Tip added by an anonymous user on Dec 15, 2008 at 10:04 am

Extend the firefox javascript run time

Categories: firefox javascript
no ratings, 0 comments
– Tip added by an anonymous user on Sep 01, 2008 at 7:48 pm

attaching events to nodes in Javascript

no ratings, 0 comments
– Tip added by an anonymous user on Aug 18, 2008 at 11:23 am

animating elements with jQuery

0% positive, 0 comments
– Tip added by an anonymous user on Aug 04, 2008 at 1:46 pm