Re: Fwd: Help with CSS?

by "Darrell King" <darrell(at)webctr.com>

 Date:  Sun, 26 May 2002 16:23:31 -0400
 To:  <hwg-techniques(at)hwg.org>
 References:  ntlworld email ais ais2 ais3 ntlworld2 ntlworld3
  todo: View Thread, Original
All good points, and I mean that.

Personally, I'll draw the line at depending on JavaScript for platform
detection, as I still don't trust that it is available reliably enough to
warrant that use.  I also avoid using JS for creating the document, for
similar reasons.  As much sense as using client-side CPU power makes, I
don't believe the support is there.

Degrading gracefully is something any intelligent design will try for, and I
certainly won't argue with the principle.  Using @import is another very
useful trick I really have to incorporate more often...:).  Still, these
relate more to presentation of text than to positioning issues, as least
where the client has decided that the NN4 version of the page should look
just like the CSS-positioned version.

However, neither of those covers the situation where the site has to deliver
a page that has to choose between CSS positioning or HTML tables to deliver
a page with a variety of locations used for the content....such as
magazine-style layouts.  It is for scenarios such as this that I depend upon
server-side sniffing.

One disagreement: sniffing doesn't have to be high maintenance.  I maintain
no more than 3 copies of the site's template...and usually only 2...and
deliver the content from the database to the viewer within the appropriate
template.  So, I maintain 1 copy of the content and 2 copies of the site's
design. Although it does rankle a bit to have to maintain that HTML 4
template for browser's like NN4, I don't think of it as extra work.  When
the time is past for that one, there will be another platform needing
special attention....perhaps a WAP audience, or something as yet unheard of.

Or just multiple stylesheets instead of multiple design templates...?

Isn't that the promise of XML (and XHTML)...?  One copy of the data, with
multiple stylesheets to deliver it to multiple platforms as detected by
server-side sniffing?

D


----- Original Message -----
From: "Andrew McFarland"

At 15:05 26/05/02 -0400, Darrell King wrote:
>Sniffing does work.

Suppose I am behind cache X and I access http://www.example.com/page.html
using browser foo. Example.com sends me a page for browser foo. So far
everything is working.

2 minutes later, somebody else access http://www.example.com/page.html,
also from behind cache X. The request never gets as far as Example.com. The
cache just sends the cached version of the page which is aimed at browser
foo, which may or may not be the correct version of the page.

_No_ server side solution can get round this for all caches, and a solution
that circumvents the cache somehow is very antisocial. Caches are there for
a reason. So are proxies.

>If there are cache or proxy issues, they will get the default page as
>intended by the site owner...presumably the simplest and oldest version,
but
>even that is dependant upon the site's target audience.

No, they will get an unpredictable page depending on the behavior of the
cache or proxy.

>No solution is 100%.  Not every client is going to want a simple, HTML 3.2
>cross-platform design.  If nothing else, it doesn't do much for cell
>phones...:). Even with the best of intention, no system will be foolproof.

The trick in an design for the web is to make it degrade gracefully. I have
yet to encounter something that actually needs different pages sent to
different browsers that doesn't have a more elegant solution. Even in the
worst case scenarios - where you need horrible code forks in JavaScript for
example - the underlying logic of the JavaScript sniffing is going to be
the same as the underlying logic of the server side sniffing, but the
JavaScript one will be cache and proxy friendly. (And you will be using
object sniffing rather than browser sniffing if you do it client side.)

>Even so, I would hesitate to refer to a 99% effective solution such as
>platform sniffing as a system that "doesn't work."

Its high maintenance and it has unpredictable results. Sounds like
something that doesn't work to me :-)

Using the @import trick to hide CSS from NS4 is the best thing to do. Cross
platform, degrades gracefully, low maintenance, etc.

HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA