Reputation: 30681
I seem to have a problem with some jQuery, and I can't figure out where I am going wrong so I just want to take ie7 out of the equation by excluding it, can this be done with jQuery?
Upvotes: 0
Views: 691
Reputation: 117334
if you need the detection inside a script(conditional comments are HTML-comments), you can detect it by checking some properties.
var ie7 = (document.all && !window.opera && window.XMLHttpRequest && typeof window.external.AddToFavoritesBar=='undefined') ? true : false;
var ie7mode = (document.all && !window.opera && window.XMLHttpRequest && !document.querySelectorAll) ? true : false;
inside a script you can use it like this:
if(!ie7mode)
{
//this will be ignored in IE7 or higher versions running in IE7-mode
}
if(!ie7)
{
//this will be ignored in IE7 only
}
Upvotes: 0
Reputation: 2975
I don't know about jQuery, but you could prevent the code from running using Conditional Comments
Upvotes: 1