[thelist] Safari details + UA string (was Apple releases new browser for OS

Peter-Paul Koch gassinaumasis at hotmail.com
Wed Jan 8 09:40:01 CST 2003


> > The reason for a server side browser detect is usually to decide which
>style sheet or js file to send to the browser. This is as bad as using a
>JavaScript browser detect to document.write the correct LINK or SCRIPT tag.
> >
> > The only valid reason for a server side browser detect is to actually
>detect which browsers come to your site and to store this information.
>
>Right.
>
>Not wanting to launch into a flame war (you should know me better than
>that by now) so here's a live situation:
>
>We needed quite a complex dhtml collapsible menu. I decided that we would
>not implement it for older navigators (like NN4.x). Yet half our intranet
>is equipped with NN4.5 (although the admins are doing their best to upgrade
>all the amchines, but hey... several tens of thousands).

A properly written DHTML menu can work in Netscape 4 (though doubtless it'll
have some quirks).

>We opted for a plain-vanilla, all-unfolded menu for older and text
>browsers, and dhtml-showoff menus for modern browsers (being on an
>intranet lets you be a little less demanding on 100% compliance, I guess).
>
>That was a valid reason to use server-side detection, wasn't it?

No. What I'd do is the following:

1) Put the menu styles in an imported style sheet except for the few styles
that you want to show in the plain version.

2) Use an init script to add the event handlers that open and close the
menu. Before executing this script, check for document.layers and if it's
supported don't execute the script.

DHTML works in higher browsers, not in NN4, and there's no need for a
browser detect (though it might be argued that the document.layers check is
a sort of browser detect).

>Actually we thought it would be more rational (especially less
>time-consuming) to go down this road rather than putting up a
>client-side-100%-compliance with such a split intranet (half-old,
>half-DOM).

For a basic DHTML navigation (making layers visible and invisible and such)
you only need a few extra lines to make it NN4 compatible.

Anyway, this is indeed a situation where you can argue about a browser
detect, especially since it's on an Intranet. I myself wouldn't use it, but
it can be defended.

--------------------------------------------------
ppk, freelance web developer
Interaction, copywriting, JavaScript, integration
http://www.xs4all.nl/~ppk/
Column "Keep it Simple": http://www.digital-web.com/columns/keepitsimple/
Nieuw: Jaaroverzicht 2002
http://www.naarvoren.nl/artikel/jaaroverzicht_2002.html
--------------------------------------------------


_________________________________________________________________
MSN 8: advanced junk mail protection and 2 months FREE*.
http://join.msn.com/?page=features/junkmail




More information about the thelist mailing list