Murach's JavaScript and DOM Scripting
How to test and debug a JavaScript application

This chapter shows you how to test and debug your JavaScript applications using the debugging tools that are provided with a browser. Because the Firebug extension to Firefox is so powerful compared to other browser debuggers, it's covered in detail. But you'll also be introduced to the debuggers that come with other browsers.

To see how well this book works, you can download this chapter and try it out for yourself.

Chapter 3 How to test and debug a JavaScript application
An introduction to testing and debugging 90
Typical test phases for a JavaScript application 90
The three types of errors that can occur 90
Common JavaScript errors 92
How to get error messages with Firefox 94
A simple way to trace the execution of your JavaScript code 96
How to debug with the Firebug extension of Firefox 98
How to install and enable the Firebug extension 98
How to get information in the Console tab 100
How to review your code in the Script tab 102
How to use breakpoints and step through code 104
How to use the Firebug console object 106
The methods of the console object 106
How to trace an application with Firebug’s console.log method 108
How to test and debug with other browsers 110
How to get error messages with Internet Explorer 110
How to get error messages with Safari 112
How to get error messages with Opera 114
How to get error messages with Chrome 116




Murach's JavaScript and DOM Scripting

Learn more about this book

View the table of contents


More about the eBook



Our 100% Guarantee

First, try our books for 90 days. Then, if you aren't completely convinced that our books are the best ones you've ever used, you can return them for a prompt refund...no questions asked.