selectivizr icon indicating copy to clipboard operation
selectivizr copied to clipboard

selectivizr not working every other page load

Open amaisano opened this issue 12 years ago • 2 comments

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

amaisano avatar Dec 29 '11 22:12 amaisano

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.

keithclark avatar Dec 30 '11 10:12 keithclark

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

amaisano avatar Jan 05 '12 18:01 amaisano