Hi!
I have a button in my page, and onclick event, if should append to the <head>
a CSS file from a server and do something else.
it works perfectly in FF but in IE, it seems not to work (it did append the <link>
to the <head>
- but the CSS won't affect the elements)
Heres my current code:
function loadDynamicCss(filename) {
var fileref = document.createElement("link")
fileref.setAttribute("rel", "stylesheet")
fileref.setAttribute("type", "text/css")
fileref.setAttribute("href", filename)
document.getElementsByTagName("head")[0].appendChild(fileref);
}
What can cause this?
Thanks!