As you can see, this reduces the amount of code contained in the
function and also makes it
clearer what the developer was thinking when writing this function.
tag) into a text
box and click the jslint button. The tool then outputs warnings and errors about your code underneath.
The types of warnings provided by jslint are in line with the professional standards mentioned through-
out this book. You receive a warning if the code contains an inappropriate coding technique, such as the
A statement (
, and so on) that doesn’t use block notation (see Chapter 2,
A line that doesn’t end with a semicolon
statement declaring a variable name that is already in use
statement (for reasons to avoid
, see Chapter 2)
and it can also be downloaded in its original source code for your own use.
Programmers used to developing in languages such as C, C++, Java, and Perl know that debugging is
an important part of the development process. These developers rely heavily on debuggers for such pro-
gramming languages to aid in tracking down errors in their code. Most languages offer some type of
doesn’t have a debugger, both Internet Explorer and Mozilla have debuggers available.
Microsoft Script Debugger
The Microsoft Script Debugger is a free utility available from Microsoft’s Web site. To download it, go to
into the Search box. The results list comes up with Script Debugger for Windows NT, 2000, XP. Click that
link and click the Download button. Run the installation program and then restart Internet Explorer.
Notice a new menu item that appears under the View menu called Script Debugger. This provides
options for running the debugger.
You can run the Microsoft Script Debugger in a number of ways. First, you can open it directly by select-
Open, which opens the debugger with no information loaded. The second
method is to select View
Break at Next Statement, which opens the debugger before
17_579088 ch14.qxd 3/28/05 11:41 AM Page 432