Getting Google Chrome to Ignore IE Javascript
- by swajak
I'm creating a slideshow using javascript that fades images. Awhile back, I discovered that to change the opacity of an image, I have to use a different API, depending on whether the page is viewed in Firefox or IE.
Firefox:
img.style.opacity = [value 0 to 1];
IE:
img.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity= [value 0 to 100] )";
So, currently, I use <script LANGUAGE="JScript"> for code that is meant for IE. This was suggested in the Mozilla docs.
The problem: Chrome thinks my <script LANGUAGE="JScript"> code is valid, when it is not.
How to make Chrome ignore the code inside <script LANGUAGE="JScript"> ? Or how to make my opacity code cross-browser?