Skip to content

Instantly share code, notes, and snippets.

@Boldewyn
Forked from connrs/qsa-polyfill-ie7.js
Created November 20, 2013 20:09
Show Gist options
  • Save Boldewyn/7570115 to your computer and use it in GitHub Desktop.
Save Boldewyn/7570115 to your computer and use it in GitHub Desktop.
if (!document.querySelectorAll) {
document.querySelectorAll = function(selector) {
var doc = document,
head = doc.documentElement.firstChild,
styleTag = doc.createElement('STYLE');
head.appendChild(styleTag);
doc.__qsaels = [];
styleTag.styleSheet.cssText = selector + "{x:expression(document.__qsaels.push(this))}";
window.scrollBy(0, 0);
return doc.__qsaels;
}
}
document.querySelectorAll||(document.querySelectorAll=function(a){var b=document,c=b.documentElement.firstChild,d=b.createElement("STYLE");return c.appendChild(d),b.__qsaels=[],d.styleSheet.cssText=a+"{x:expression(document.__qsaels.push(this))}",window.scrollBy(0,0),b.__qsaels});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment