Browser and OperatingSystem Detection
Browser and Operating
A big part of Web programming is identifying target browsers and operating systems. Whether
you are building a simple Web site or a complex Web application, this important information must
be determined before any work begins. Because browsers support different levels of HTML and
your targets. This ensures that you won’t include features that aren’t available to your users.
Today, the challenge is even greater with the vast number of Web browsers available on so many
different platforms. Windows users can use Internet Explorer, Mozilla, and Opera; Macintosh
users have Internet Explorer, Mozilla, and now, Safari; Unix users can use Mozilla as well as
Konqueror. Developing for all of them requires a great deal of forethought and a well-planned
approach to dealing with their similarities and differences.
prepare you to develop cross-browser solutions.
The Navigator Object
The most important object in client-side browser detection is the
object is one of the earliest BOM objects implemented (beginning in Netscape Navigator 2.0
number of properties that can give you information about the browser, such as the name, version,
Although Microsoft objected to the term
as being specific to Netscape’s browser, the
object has become a sort of de facto standard for providing information about a Web
browser. (Microsoft does have its own object called
in addition to the
object, but they both provide similar data.)
11_579088 ch08.qxd 3/28/05 11:38 AM Page 225