[Home]DetectingBrowser

ec2-18-209-209-246.compute-1.amazonaws.com | ToothyWiki | RecentChanges | Login | Webcomic

Vitenka is the one arguing 'never do browser detection' here.
Discussion moved from JavaScript.
Probably needs expanding and refactoring.

Fail gracefully.

Make links that execute javascript if they can, or trigger normal server side operation if they cannot.  Use 'return false' in your click actions to prevent both happenning at once.  Use the NOSCRIPT tag... and whatever else you do - don't fill it with "enable javascript or go away" - or rely upon javascripts presence to do browser detection. 

NEVER do browser detection
Why never do browser detection?  It can be useful from time to time, although I would agree the best method of such is using javascript to detect its own presence. - Kazuhiko
Because your site should simply degrade into each browser.  If you think you need browser detection, then you almost certainly tried something overly clever and cocked it up.  If you absolutely must do detection, do it based upon 'feature supported' - you don't want to have to cope with every possible browser and you certainly don't want to have to maintain it forever.  And, of course, you've forced most non-IE browsers to simply fake their version string responces anyway.
Ah, slight confusion there.  My idea of browser detection is of the 'feature supported' variety rather than the 'Oh look, not IE!' variety.  I like the idea of having personally forced browsers to fake their version string but...  If the browser detection script was written well, then a non-IE browser pretending to be IE would only lead to errors with script that was never supposed to be run on IE.  This, of course, assumes that the programmer doesn't lump everything non-IE into the 'nothing works' category (or, even better, into the 'here's a link to upgrade to IE' category :) ) which I'm guessing is what you are accusing me of... - Kazuhiko
Ok, first, obviously, 'you' is referring to 'in general' not you specifically.  Feature supported should be done by the individual elements, (using ALT tags, for example) rather than having to maintain a list of what every browser supports.  Come to think of it, even IE fakes its version string, in that it looks like Netscape2 to something that doesn't look very hard.  Done properly, the whole thing should just degrade nicely - no script required.



CategoryComputing

ec2-18-209-209-246.compute-1.amazonaws.com | ToothyWiki | RecentChanges | Login | Webcomic
Edit this page | View other revisions | Recently used referrers
Last edited February 24, 2004 4:49 pm (viewing revision 2, which is the newest) (diff)
Search: