How to switch off JavaScript programmatically only for Internet Explorer 7?
I want to turn off JavaScript using JavaScript (and/or jQuery) code, o开发者_Go百科nly if the page is viewed in IE7.
How can this be done?
Would be grateful for the magic code snippet!
Use conditional comments.
http://msdn.microsoft.com/en-us/library/ms537512(v=vs.85).aspx
<![if !(IE 7)]>
// Script tags here
<![endif]>
You can check if ($.browser.msie && $.browser.version < 8)
and not run your code.
You can´t turn JavaScript off. You can however exclude IE7 by using Downlevel-revealed Conditional Comments.
精彩评论