HTML and CSS Reference
happens you'll need to debug the code—find the errors and correct them.
take as follows:
aalert("Welcome to my web page!");
Save the file and view it in the browser again. Notice that the alert box does not display
Error Console to see them.
In Firefox, select the menu items Tools, Error Console. The Error Console window will
open and the error message will display, as shown in Figure 14.9.
Notice that the error is displayed, along with the line number where the error was
detected. It's useful to create your documents in a text editor that displays the line num-
bers, but it's not necessary. If you are using Notepad, make use of the Go To feature in
the Edit menu. This will allow you to specify a line number and the insertion point will
be positioned at the beginning of that line.
Edit the alert.html file to correct the error and test it in the browser again. This time the
alert box should display after the first heading, as we saw previously.
It will display the syntax errors, which include things like missing brackets and items it does not
recognize. Sometimes the error is above the line indicated, particularly if there is a missing
bracket or quote. The errors displayed indicate that there is something wrong and they serve
as a guide to where the error might be. Start by looking at the line indicated, and if that line
looks correct, look at the lines above it.