Ever surfed to a Web page and had your browser throw up all over some weird VRML or inline video format? Or choke on a homepage sprinkled with .bmp files? Broken icons, dialog box warnings - why all the mess? Why aren't Web browsers smart enough to download only the stuff they can deal with?
Well, they should be.
When you follow an address to a Web site, your browser and the site's server immediately start talking to each other. Your browser says, roughly, "Hi, I'm at my.net.service.com and need the page at index.html. Oh, and by the way, I'm Navigator 3.01, and I'm running on Windows 95. Send me everything you've got." And the server does.
Pretty straightforward, until you realize that the browser has asked for any file type. Yup, that means any file format imaginable - video, audio, 3-D, whatever - even if your browser can't display them.
Why does it do this? Your browser communicates with a server via hypertext transfer protocol (HTTP), and sends an HTTP header with every hit. Inside that header are a number of different pieces of information. One of those pieces, HTTP_ACCEPT =, tells the server which MIME types (that's Net lingo for transferring media) the browser accepts. Navigator 3.0, for example, can read these MIME types: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*. Seems pretty obvious what Netscape can display, until you get to that last entry - */* - which translates to "everything you've got."
The "*/*" is a holdover from the days of helper applications. In the past, browsers couldn't even display images, so when they came across something they didn't understand, they'd just send it to an application that knew what to do with it. But now, as your browser is slowly turning into your whole operating system, you end up with junk you can't deal with. This is especially problematic for new users.
So, to avoid broken icons, content providers started looking at another HTTP element: HTTP_USER_AGENT. The User Agent string lets the browser identify itself to servers. My version of Navigator, for example, says "Mozilla/3.0 (Macintosh; I; PPC)" every time it hits a server. Now all we need to do is write a script that looks at the HTTP header and serves up individual page elements to different browsers.
Well, we could, except that most content providers simply divert Netscape users to one set of pages, and everyone else to another. So - to avoid having their users funneled to a plain-Jane page - all the other browser creators started lying in their User Agent strings, saying they were actually Mozilla, so their users could get all the bells and whistles of the Netscape pages. A desperate spiral of compatibility and ever-increasing layers of complexity ensued. If people tell you HTML is cross-platform - laugh at them.
How can we get rid of this mess? Simple. Browser vendors can list the media types they support in the HTTP_ACCEPT string, and content providers can set up a few simple filters for their Web sites. Why, people may even start using Netscape's plug-ins!
Or, we can dream of utopia, and spend our days writing elaborate compatibility scripts....