title: Put the knife down and take a green herb, dude. |
descrip: One feller's views on the state of everyday computer science & its application (and now, OTHER STUFF) who isn't rich enough to shell out for www.myfreakinfirst-andlast-name.com Using 89% of the same design the blog had in 2001. |
FOR ENTERTAINMENT PURPOSES ONLY!!!
Back-up your data and, when you bike, always wear white. As an Amazon Associate, I earn from qualifying purchases. Affiliate links in green. |
|
Friday, February 01, 2002 | |
Just got an email pointing towards the "Ultimate client-side JavaScript client sniff. Version 3.03". This is certainly the be-all, end-all of detecting which client is taking a look at your web page, but has much too much overhead for me to ever think about using. It's been around for a while, but I thought I'd blog it. Here's an example of what I mean. There's a check for Javascript version and also for what kind of OS the client's using. Here's part of the OS check: var is_aix = (agt.indexOf("aix") !=-1); // IBM var is_aix1 = (agt.indexOf("aix 1") !=-1); var is_aix2 = (agt.indexOf("aix 2") !=-1); var is_aix3 = (agt.indexOf("aix 3") !=-1); var is_aix4 = (agt.indexOf("aix 4") !=-1); That is to say, if we're interested in seeing "uplevel content", we're probably using Mozilla. I don't need five checks for OS when it has no bearing on what I'm going to do with my html -- I'm not going to write a different page for AIX. I just don't care what OS we've got (on a practical level). What am I going to do with these vars? You might say "hack them out", which is exactly what I do, but with these bytes, not a subset of their 14k of bytes (incl whitespace): if (document.layers) { // NS 4 A little from my ye ole email reply: Regardless of this falling into "CLASSIC MISTAKE #2 IN CLIENT DETECTION: CONFUSING OBJECT DETECTION WITH CLIENT DETECTION", it's quite a bit smaller than the 14k crap this bit has. I'm also, for better or worse, not worried about WebTV users or HotJava or Opera. They get whatever's in the "else", which is what lynx users get too, or they get whatever they pretend to be (eg Opera has partial DOM1 -- if their impl stinks, that's their job, I think.) posted by ruffin at 2/01/2002 09:50:00 AM |
|
| |
MarkUpDown is the best Markdown editor for professionals on Windows 10. It includes two-pane live preview, in-app uploads to imgur for image hosting, and MultiMarkdown table support. Features you won't find anywhere else include...
You've wasted more than $15 of your time looking for a great Markdown editor. Stop looking. MarkUpDown is the app you're looking for. Learn more or head over to the 'Store now! |
![]() |
|
|