Reputation: 71
I need to control CSS with a cookie:
My first strategy was to set an onload handler on the <body> element. I've seen discussion of at least two other approaches:
document.write
to create a <link> to a stylesheet in the <head> as the page is being built. I'd be grateful for advice about choosing a strategy that is easy to code and maintain and that provides the functionality I need in the browsers I need to support.
Upvotes: 0
Views: 747
Reputation: 24617
Use a combination of techniques to avoid the root cause, which is repaints and reflows:
References
Upvotes: 1