I have a line of code that doesn't work in IE8 and lower.
var mediaQueryId = getComputedStyle( document.body, ":after" ).getPropertyValue("content");
var mediaQueryId = mediaQueryId.replace( /"/g, '' ); // 'null' is null or not a object
I tried to use this fix in order to make it work but I get this error:
'null' is null or not a object
Here's my code:
if (!window.getComputedStyle) {
window.getComputedStyle = function(el, pseudo) {
this.el = el;
this.getPropertyValue = function(prop) {
var re = /(\-([a-z]){1})/g;
if (prop == 'float') prop = 'styleFloat';
if (re.test(prop)) {
prop = prop.replace(re, function () {
return arguments[2].toUpperCase();
});
}
return el.currentStyle[prop] ? el.currentStyle[prop] : null;
}
return this;
}
}
The website is http://www.gablabelle.com/