Re: Using DOM to replace media attribute in the link tag on page load

David Perrell wrote:
>  I'm still seeing a lot of pre-XP Windows with IE < 7 in my web server
>  logs. It'll be a while before implementation of that change is a
>  good idea.

I said “up to version 7”, so that includes version 7 itself too. The way 
that I implement it is by use of conditional comments:

|<!--[if !IE]>-->
<script type="application/ecmascript">
    // do something
</script>
<!--<![endif]-->
<!--[if IE]>
    <script type="text/ecmascript">
       // do something
    </script>
<![endif]-->|

Alternatively, the following works if you want to combine embedded 
scripts (with tracks for WIE and non‐WIE browsers):

|<!--[if !IE]>-->
<script type="application/ecmascript">
    // <!--<![endif]--> <script type="text/ecmascript">
    // do something
</script>|

Admittedly, this is extra work for something that seems to be mostly 
cosmetic.

Hopefully, WIE8 will support the two new MIME types so that the 
messiness above can eventually be done away with. (I’m not willing to 
test pre‐release software on this computer to find out if this issue is 
fixed in WIE 8 Beta 1 though.)

— Patrick Garies

Received on Wednesday, 23 July 2008 12:37:17 UTC