Chapter 20. Debugging Common Errors

It's often said that 90% of the time you spend writing programs is actually spent debugging them—that is, making them work after they've been written. Add to this the sad fact that none of the browsers that support JavaScript show meaningful error messages, and you have a recipe for frustration. This chapter shows some of the most common JavaScript errors, how to identify them, how to fix them, and how you can avoid them in the first place.

The Built-in Debugging Aids

The two major browsers, Microsoft Internet Explorer and Netscape Communicator, come with some limited features that can help you debug your code. Here's a brief rundown.

Microsoft

Internet Explorer 4 and later for all platforms provides a dialog box ...

Get Javascript for the World Wide Web: Visual Quickstart Guide, Fifth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.