• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 12. Debugging Your Code > Understanding the Various Types of Errors

Understanding the Various Types of Errors

When a problem occurs, the first thing you need to determine is what kind of error you're dealing with. There are three basic types: syntax errors, runtime errors, and logic errors.

Syntax Errors

Syntax errors arise from misspelled or missing keywords or incorrect punctuation. JavaScript almost always catches these errors when you load the page (which is why syntax errors are also known as load-time errors). That is, as JavaScript reads the script's statements, it checks each one for syntax errors. If it finds an error, it stops processing the script and displays an error message. Figure 12.1 shows Netscape's JavaScript Console window flagging a typical syntax error.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint