In a Web designer's dream world, all browsers would behave in the same way. They would all render HTML predictably and offer identical support for features like tables and frames. They might even support some standardized DOM.
But we don't live in a Web designer's dream world, and we can't expect to. For example, it would be silly to expect a text-based browser like Lynx to be able to handle all the same features as a graphical browser like Opera.
As a result, it has become common practice for Web sites to tailor the HTML that they send to different browsers. This can be done in a variety of ways - basically any way that you can dynamically generate HTML. But whether you do it with a CGI program, an ASP page, or a Java servlet or even by configuring your Web server, there must be some way for a browser to identify itself to your server.
That's where the User Agent string comes in.
next page»