[thelist] Script for M$IE only, or not

Christian Heilmann codepo8 at gmail.com
Mon Apr 3 04:37:17 CDT 2006


> > if (document.all) {
>
> Rumor has it that new versions of Firefox support document.all syntax.
> Though I'm not sure.
> Anyway, why should you write vendor-specific css since most of the modern
> browsers display almost identical if you treat them good enough.

document.all is supported by Mozilla but only in part:
http://weblogs.asp.net/jgalloway/archive/2005/08/07/421798.aspx
http://mozillanews.org/?article_date=2004-07-23+18-06-59 (aahhhrghh
animated favicon!!!)

The only bullet proof way seems to be conditional comments:

<script type="text/javascript">isIE=false</script>
<!--[if IE]>
<script type="text/javascript">isIE=true</script>
<![endif]-->

and then check for isIE

if(isIE){alert('CSS transition filters, coloured scrollbars, tigers,
elephants, yay!');}

Dirty mixing of structure and behaviour though. The other suggestion
of picking one of the more obscure MSIE only objects makes more sense,
but then again browser sniffing doesn't make much sense anyways.

HTH
Chris

--
Chris Heilmann
Blog: http://www.wait-till-i.com
Writing: http://icant.co.uk/
Binaries: http://www.onlinetools.org/



More information about the thelist mailing list