[thelist] Stylesheet switching Jitters

Sam Carter sam at iness.com
Tue Mar 8 12:25:09 CST 2005


If your functions aren't referencing anything in the document, why

> wait for "onload"? {WAG/untested!} why not try running this inline?
>
> <script type="text/javascript">
> var cookie = readCookie("style");
> var title = cookie ? cookie : getPreferredStyleSheet();
> setActiveStyleSheet(title);
> setGraphics(true);
> </script>

Thank you to Hassan and Chris for both suggesting workable solutions.  
While Chris' solution was sure to work, Hassan's suggestion to not wait 
for onload required less coding, and it worked.

Thanks to everyone for responding.

Sam



More information about the thelist mailing list