Failsafe load for attaching stylesheet

/ Published in: JavaScript
Save to your folder(s)

The setTimeout ensures that if there is an issue attaching the link to the bottom of the head (e.g. if the head hasn’t finished loading when the link is trying to be attached) it retries after 100ms. Resetting the css variable to null avoids potential memory leaks.


Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.