Change stylesheets asynchronously


#1

I have my default “scaffold.css” that loads when the page loads, however
I would like to be able to dynamically change the CSS sheet by clicking
a link. I tried wrapping the stylesheet like below:

and then using link_to_remote to update the “css-theme” div, but that
did work exactly as I was expecting. Can someone give me some ideas as
to how I can do this? I wouldn’t think it would be too hard.


#2

This is a pretty widely used method.

Works great too.

http://www.alistapart.com/articles/alternate/