In this section, we describe some of the many types of clients currently available on the Web, and then we discuss ways in which they differ.
Here is a selection of clients that commonly access Web pages:
These clients are often profoundly different from one another.
As the Web has developed, so have Web browsers. New browser standards and proprietary features continue to be proposed and incorporated that are supported only in some clients. Often a standard or a feature is only partially supported, or it might have bugs in the way it is implemented by certain browsers. Additionally, a standard might have acknowledged problems that are intentionally not supported. Very few aspects of Web technology are supported identically in all browsers. Table 23-1 discusses support of a few widespread features in the most common browsers—Internet Explorer and Navigator.
Table 23-1 Cross Browser Support for Common Features
Feature | Notes |
---|---|
Frames | Best supported in version 3+ browsers. |
HTML 3.2 | Best supported in version 3+ browsers, although version 2 browsers provide fair support. Defines support for tables and many other common HTML tools. |
HTML 4.0 | Fair support in Internet Explorer 4, less in Navigator 4. Both browsers support this standard better with each new version. HTML 4.0 defines standards for frames, new tags, and new attributes, such as TITLE, which allows for pop-up text over almost any element and is supported in Internet Explorer but not currently in Navigator. |
CSS | Support introduced in Internet Explorer 3, followed by Navigator 4. Internet Explorer versions 4 and later currently provide the most support. Differences in support among browsers (especially with Internet Explorer 3) sometimes cause problems. Opera 3.5 and later also provide good support. Indications are that Navigator 5 will have much improved CSS support. |
JavaScript | First supported in Netscape Navigator 2, and then in Internet Explorer 3. Many subsequent changes make for some challenges with cross browser script. The introduction of ECMA-262 support in Internet Explorer 4.0 and Navigator 4.06 is helping to smooth out the bumps. |
Java | Unpredictable prior to version 3 browsers. Java has improved as browsers have evolved. |
Object Model | Variable support in all browsers. Some aspects of the Object Model have been around since the beginning of browsing. Version 3 browsers had much better support than earlier versions. Version 4 of Internet Explorer greatly expanded the Object Model to one that allowed accessing and changing almost all elements on a page. The W3C DOM specification should help drive the standardization of an Object Model among browsers. Tools like Scott Isaac's DHTMLLib (explained later in this chapter) can help make these differences in support easier to deal with. |
ActiveX Controls | Supported in Internet Explorer 3 and later, with minor advances with each new version. The ScriptActive plug-in from NCompass Labs can add a level of ActiveX support to Netscape Navigator. |
Forms | Well-supported in version 3+ browsers. Unfortunately, they are represented differently in the Object Models of each browser. Learn more about cross browser forms later in this chapter. |
As you can see, there is great variation in support of various standards and features. Programming for the Web is always a tradeoff between using neat new features and providing support for the widest possible audience.
A recent analysis of the usage logs of a particular high-traffic Web site revealed that more than 200 different browser clients had accessed it. These clients ranged from version 2 of both Netscape Navigator and Internet Explorer to unreleased beta versions of each of these browsers. They included other browsers, such as Opera, Mosaic, and Lynx, as well as a number of different Web crawlers. These diverse clients resided on operating systems ranging from Windows 3.1 to various flavors of Unix and different versions of the Macintosh operating system. These browsers have obvious and subtle differences among them.
However, despite this variety of Web clients, more than 96 percent of the traffic on the Web site described above came from people using the two most recent full versions of either Internet Explorer or Netscape Navigator. Keep in mind that the percentages of different clients that access a site vary tremendously from Web site to Web site. The users of msdn.microsoft.com are more likely to use Internet Explorer than are visitors to developer.netscape.com. Developers for the Apple Web site at apple.com are probably more concerned with making their site work on Macintosh machines than those creating an intranet for a PC-only company.
Ultimately, Web site developers need to decide what types of clients they will support based on the type of user they expect to visit their sites. All modern Web server applications can track the types of clients that access them. If possible, you should obtain a report (typically an analysis of the log files from the server) that breaks down the clients that visit your site. Luckily, there are many techniques for creating cross browser content.