KPMG.com Fall Down, Go Boom
Published 22 years, 2 months pastLife is so damned ironic sometimes I have to pause in wonder. While taking a break from doing technical review on a book exhorting standards-based site design, I spotted on Zeldman (and he spotted it at Supafamous) a note that KPMG‘s Web site (as well as its Canadian counterpart) completely shatters in Mozilla, Netscape 6+, and basically any other non-IE browser. (Unless it’s Opera, in which case the Canada site doesn’t even let you in at all.)
Why does this happen? Bad browser sniffing. Somewhere on KPMG’s server(s), a script looks at the user agent string of the browser asking for a page. For Gecko-based browsers like Mozilla et.al., this script decides that it’s dealing with Netscape 4.x, and so hands over a script that’s tuned for said browsers. An tiny little excerpt:
if (tar == 'A') { document.layers['search_form'].document.forms['searchFormA'].submit(); } else { document.layers['search_nav'].document.forms['searchFormB'].submit(); }
There’s plenty of other broken stuff, like dynamically writing out layer
elements and setting the visibility
of said layers to hide
, instead of the correct value, hidden
.
This is a perfect example of why browser sniffing is nearly always a terrible idea: failure is never more than an unrecognized (or misidentified) browser away. I’ve taken a look at the page in Explorer, and I’m pretty sure the page can be rendered the way they want it in Gecko-based browsers. The question is this: should I invest the personal time and energy to offer them, for free, what Razorfish probably charged them a very large sum of money to not deliver?
In the end, thanks to my annoyingly ingrained sense of community good, I probably will. I’ll let you know how it turns out. In the meantime, I have to get back to that technical review.