If you're talking about content negotiation in the way I think you are (by
the values passed to the server in the 'Accept' HTTP header) and not by
getting the value of the 'User-Agent' HTTP header, then I'm all for it.

One of my recent thoughts was to check if the UA had 'text/xml' or
'application/xhtml+xml' in the Accept header, and sending them back the
appropriate mime-type for XHTML, while everyone else gets text/html. I'd
even thought of going to the length of using PHP's output buffering to
rewrite the XHTML into HTML4 for the text/html version so that it's totally
valid, but that just seems like way too much work for so little gain :)
(also, the W3C validator doesn't send an Accept header, so it would be
getting HTML4 - still valid, but not exactly ideal to say a site is valid
XHTML then have the W3C say it's HTML4 :))

To me, this doesn't seem like a hack at all, it is exactly what the Accept
header is for - serving up different content types depending on what the
browser (says) it supports.

I'm sure you could also do the same with XML, and either send XML plus a
stylesheet to UAs that support it, and do a server-side transform to HTML
for those that don't (There are probably a number of flaws in this though
(probably the biggest being that you'd have to write two versions of your
presentation code), and I'll be stuufed if I can think of a single reason
*to* do it apart from the 'hey, cool, I can do it' factor)

/me should get back to work now...

 Lindsay Evans.
 Red Square Productions.

 [p] 8596.4000
 [f] 8596.4001
 [w] www.redsquare.com.au

> -----Original Message-----
> From: Ben Boyle [mailto:[EMAIL PROTECTED]
> Sent: Thursday, 9 October 2003 10:02 PM
> Subject: [WSG] Targeting IE5
> I would have thought the best way to target a browser (be it IE5 or other)
> was content negotiation. Detect the browser and serve content in the
> appropriate format. Does anyone else get the feeling this technique is
> rarely used whilst cruder methods proliferate?
> IMHO, web servers can do a lot more than just serve files and should be
> exploited for all they are worth - and that's plenty. I feel this
> cornerstone of the web is oft overlooked, much to the detriment of the
> online experience when cruder technologies are called on to compensate.
> Maybe it's just too difficult for developers to get access to webserver
> configuration, or too tedious to produce content in multiple
> formats? Gotta
> weight that against the time and effort we've all invested in workarounds
> and hacks though ... The right tool for the job. One can't solve every
> problem with a hammer.
> cheers
> Ben
> *****************************************************
> The discussion list for http://webstandardsgroup.org/
> *****************************************************

The discussion list for http://webstandardsgroup.org/

Reply via email to