Helping ordinary people create extraordinary websites!

JavaScript Debugging Techniques with Firebug

By Akash Mehta
2008-04-20

Understanding JavaScript errors
When working with JavaScript, there are three main types of errors you will encounter:
  • Syntax errors
  • Runtime errors
  • Logic errors

Syntax errors refer to simple errors in code - for example, missing a parenthesis in an if statement for if variable==value) - which will trigger an error in the JavaScript interpreter.

Runtime errors are those that are valid JavaScript code, but fail for some reason based on the context or what they do. These include, for example, referring to a variable that does not exist or is not visible within the current scope, or working with one data type as if it is another.

Finally, logic errors, the hardest to identify, refer to mistakes in the code - for example, making a particular comparison when you actually want to be making another. These are most commonly found in the complaint "my code does one thing when it should do another entirely". If you find yourself in this situation, you probably have a logic error. Advanced debugging techniques make identifying logic errors very easy.





Tutorial pages:
 3 Votes

You might also want to check these out:


Leave a Comment on "JavaScript Debugging Techniques with Firebug"
You must be logged in to post a comment.

Link to This Tutorial Page!


GET OUR NEWSLETTERS