[thelist] http_user_agent

Erik Mattheis gozz at gozz.com
Thu Mar 21 00:40:00 CST 2002


>  > in which case you should document.write() to different
>>  external stylesheets based on the userAgent ...
>
>i shall overlook how suspiciously similar to javascript syntax this is, and
>assume that you meant to advise doing browser sniffing on the server

No, I meant just that ... if the decision is made on the server, a
proxy server in between the server and the browser may cache a URL
you intend for a particular browser and serve it to a browser other
than which you intended it for.

I was suggesting something like:

if (document.all) {
  	document.write('<link rel="stylesheet" href="/styles/ie.css"
type="text/css" />');
}
else if (document.layers) {
     document.write('<link rel="stylesheet" href="/styles/ns4.css"
type="text/css" />');
}

>  > some people like to use @IMPORT.
>
>some purists consider this a hack, but it is a very effective strategy

@import is sometimes insufficient. For instance IE 5 Mac vs. IE 5 Win.

>serving different stylesheets to different browsers might work, but it
>takes a lot of effort -- it's like pushing a rope

Well, if you're "pushing the envelope" you sometimes have no choice
but to figure out how you're going to push a rope!

>you really have to ask yourself -- not you personally, erik, i guess i
>should say one really has to ask oneself -- just why one would want to
>develop separate style sheets

Some of us first ask ourselves: "How can I achieve this?" and then
"What is the best way to achieve this" ... I don't ever tell client's
"It can't be done" if I know of a way it can be done ... even if I
can't or would rather not do it myself. Challenges are cool.
--

__________________________________________
- Erik Mattheis

(612) 377 2272
http://goZz.com/

__________________________________________



More information about the thelist mailing list