|
Helping ordinary people create extraordinary websites! |
JavaScript Debugging Techniques with FirebugBy Akash Mehta2008-04-20
Understanding JavaScript errors
When working with JavaScript, there are three main types of errors you will encounter:
Syntax errors refer to simple errors in code - for example, missing a parenthesis in an 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: » Understanding JavaScript errors » General debugging » JavaScript debugging tools » Debugging syntax errors » Debugging runtime errors » Debugging logic errors » Further reading |
|