I am pretty much worried to make a duplicate with this question while more than on hour seems to be too much for navigating for the answer.
The situation is:
- Widget, which needs to load css dynamically
- Sammy.js and .ejs for views - most of all the html content is loaded dynamically
- Lab.js to load javascripts
- one loaded styles should apply to all the new content which instantly appears on the page
I've already tried the answers from these related posts:
- dynamic CSS loading in IE won't work
- Dynamically changing stylesheet path not working in IE and Firefox
(..and others)
The only thing which works for me even in the modern browsers is the injection of the "style" node with the inline styles inside. But this doesn't work in IE8 :( I do see the style node in the Developer Tools, but they do not apply. I've also tried to wait until the stylesheet is applied before starting the sammy.js application.
I would really appreciate your answer or a link to the related question and working answer.
P.S. I fix IE8 now, but IE7 working is also in the plan.