Image by vjl via FlickrCan you please tell me how to add external stylesheets with JavaScript? I’m trying to add them by creating a link element with a rel=”stylesheet”, type=”text/css” and a valid href and then appending this to the head element but it doesn’t seem to work. I’m quite sure my css files are good since when stripped down they only contain body {background-color:#ff0000;}.
It’d be great if you could post a solution because I really don’t want to spend another hour thinking about this – I already spent four and I got nowhere.
![Reblog this post [with Zemanta]](http://img.zemanta.com/reblog_e.png?x-id=d48c96f5-545f-486e-a06b-91b1ed732fe4)
