I have the following function in javaScript. This function is called when i detect a need to re-load the stylesheet. for example, doe to user language change, so the text won\'t
Is it possible you are starting the timer more than once? Could you try:
var timeout_id = (function() {
if (timeout_id) {
// a timer is already running!
clearInterval(timeout_id); // stop it - or you could just return and not create a new one
}
return setInterval(function() {
if (link[sheet] && link[sheet][cssRules].length) {
clearInterval(timeout_id);
that.onStyleReset();
}
}, 10)
})();