Preventing javascript execution in IE6

I want to prevent some parts of my javascript written with jQuery, if it matters, from executing in IE6. What are the preferred methods for doing this?

Thanks!

0


a source to share


4 answers


You can use conditional comments to define a variable and check if it is set at runtime.



Syntax <!--[if IE 6> <script ... /><![endif]-->

. The content of the comment is invisible to all other browsers, so it is really reliable.

+3


a source


Since you mentioned jQuery why not use the " if ($.browser.msie

" construct . I think this resource will be useful to you



+1


a source


As per your stated goal, you should use Progressive Enhancement instead of browser detection.

0


a source


You just need to use browser detection script and condition on IE6 so your scripts won't run. here's a link to browser javascript detection .

0


a source







All Articles