HTML and CSS Reference
an HTML table and how it is represented as a tree where each element is related to its
parent and siblings as described by the W3C shown at http://www.w3.org/DOM.
interpreter, which executes the script. Because each browser has its own interpreter,
there are often differences in how the code will be executed. And as the competing com-
panies improve and modify their browsers, new inconsistencies may occur. There are
not only different types of browsers to cause the incompatibilities but also different ver-
sions of the same browser. Because modern browsers conform to the W3C standards,
these inconsistencies tend to be less of a distraction than they were in the past. Popular
browsers today are shown in Table 1.2.
Table 1.2 Modern Browsers
The little script in Example 1.3 should tell you what browser you are using. Even
though the application name might display Netscape for Firefox and Microsoft Internet
Explorer for Opera, if you examine the user agent, you will be able find Firefox or Opera
as part of the output string (see Figure 1.9). Programs that determine the browser type
are called browser sniffers. We have a complete example in Chapter 10, “It's the BOM!
alert("User appName is "+ navigator.appName +
"\nUser agent is "+ navigator.userAgent );