keithclark / selectivizr

selectivizr is a JavaScript utility that emulates CSS3 pseudo-classes and attribute selectors in Internet Explorer 6-8.
1.71k stars 246 forks source link

IE9+ Agent with documentMode < 9 Bug #77

Open kevindees opened 11 years ago

kevindees commented 11 years ago

I had to create this fix so that IE9+ when using IE8- Document Mode will still run the script.

// If were not in standards mode, IE is too old / new or we can't create
// an XMLHttpRequest object then we should get out now.
    if (doc.compatMode != 'CSS1Compat' || ieVersion<6 || ieVersion>8 || !xhr) {
            if(document.documentMode > 8 || typeof document.documentMode === "undefined") {
                return;
            }
    }
gucong3000 commented 10 years ago
var ieVersion = doc.querySelector ? doc.documentMode : (doc.compatMode == "CSS1Compat" ? "XMLHttpRequest" in win ? 7 : 6 : 5);