keithclark / selectivizr

selectivizr is a JavaScript utility that emulates CSS3 pseudo-classes and attribute selectors in Internet Explorer 6-8.
1.71k stars 247 forks source link

selectivizr not working every other page load #27

Open amaisano opened 12 years ago

amaisano commented 12 years ago

Every few page loads or refreshes, this script doesn't run, or does not run correctly. I can tell because every few refreshes, the tell-tale 'slvzr-' classes are missing, as if the script never ran at all.

What would cause selectivizr, or any script for that matter, to not work every few page loads?

A full description of the problem is here:

http://stackoverflow.com/questions/8660508/ie7-and-ie8-randomly-not-able-to-load-external-script

keithclark commented 12 years ago

Can you try using selectivizr 1.0.3b to see if that solves your issue. I've changed the way selectivizr initializes itself which may solve your problem.

When using the newer version, make sure it's included after your CSS since selectivizr now collects up stylesheets during the initialization process (which now happens inline, not after DOM load). In your case, you may need to add selectivizr after the script that inserts the dynamic CSS rule.

Try that and let me know hoe you get on.

amaisano commented 12 years ago

Does it need to wait for the DOM to be completely loaded, or does it take care of that itself?