I'm making a zoom button to add and remove a CSS file and for some reason I can't seem to add it in IE 8
First I tried this
document.createStyleSheet('style/zoom.css');
given that the jquery solution
$("head").append($("<link my style sheet />"));
seems to only work in FF and IE9 via my testing
I checked around the overflow and found this solution
$('#zoomlink').replaceWith($('<link>', {
id: 'zoomlink',
href: 'style/zoom.css',
type: 'text/css',
rel: 'stylesheet'
}));
But still no love to be found so then frustrated i found this
var $link = $('<link>');
$('head').add($link);
$link.attr({
type: 'text/css',
href: 'style/zoom.css',
type: 'text/css',
rel: 'stylesheet',
media: 'screen'
});
which im not certain would ever work but then finally i decided it way time to simply post a question.
I'm still not certain on how to remove the style sheet later via javascript but I need to first determine how to add a new style sheet in IE 8.
.addshould be.appendalso.