Website Magazine

Debugging JavaScript in Firefox

Did you know that you can easily debug JavaScript errors with Firefox?

First, start off by installing the web developer toolbar for Firefox.. You do not really have to download this in order to see the errors - but it is a great utility for developing web applications.

So, lets say you are creating a JavaScript validation for a form and forget to include a quote in an alert statement - like so:
JavaScript Error Example

So now your script will not work!

Depending on your version on Firefox, follow these steps to debug your JavaScript errors:

  1. Click on Tools/Error Console:
    JavaScript Firefox Debugging Example
  2. Now you are presented with a clear description of the error that includes error type and line number. You can also click on the error link to be taken directly to the line of code that has the error in the source:JavaScript Firefox Debugging Example 2

Filed under: JavaScript

3 Responses to “Debugging JavaScript in Firefox”

  1. Better yet, install Firebug inside of FF and debug with console.log - much easier and more robust.

  2. Thanks for the tip Nate! :-)

    I have Firebug and use it often. It is a great tool.

    I am still trying to push FF on my students. Why do people hold on to IE like a life raft?

  3. Man, I wish I knew the answer to that. For all of my family and friends on PC’s, thats the first thing I do - remove the E and replace it with FF.

    Firebug is an incredible tool, besides the JS debugging info. It works wonders in conjunction with the web developer toolbar.

Leave a Reply