20.10. JavaScript Errors and Troubleshooting

Although JavaScript syntax is fairly straightforward, it is incredibly easy to make mistakes that cause your scripts not to function the way you intend. This section will provide some troubleshooting tips to aid you in solving your scripting problems.

20.10.1. Using the Right Tools

First and foremost, using an editor designed to edit code is essential. Although any text editor will work, code-friendly editors offer features such as auto-indenting, syntax highlighting, and regular expression search-and-replace functions.

Some of the tools in the following list are open source and others are commercial. Most of the commercial applications offer free trial versions. Capabilities between the various editors vary — pick an editor that offers the capabilities you need in the price range that works for you.

Windows users should explore tools such as the following:

Linux users should explore tools such as the following:

Macintosh users should explore tools such as the following:

20.10.2. Common JavaScript Syntactical Mistakes

There are several ...

Get Web Standards Programmer's Reference: HTML, CSS, JavaScript®, Perl, Python®, and PHP now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.