Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

rendezvouscp

macrumors 68000
Original poster
Aug 20, 2003
1,526
0
Long Beach, California
Alo. I've been using Paul Sowden's ALA solution for the color switcher in a website I'm working on. Quite simply, it uses JS to load a cached style cookie, change that cookie on the user's request, and re-cache the saved style in a cookie one the document is "unloaded."

In this lies my problem. With the introduction of Safari 1.3 (and soon, Safari 2.0), this function is broken. From my understanding, all or most other browsers can use this function perfectly, with little to no defects. However, Safari doesn't like this, and I've come up with a solution, but after spending five hours to figure out how to implement it, I'm stumped.

So, quite simply, I want the color to be cached immediately in the user's browser cache upon them selecting the color (which means it'd be cached at the same time the color is being switched to). Can anyone point me in the right direction, or help me make the modifications to this JavaScript script to accomplish what I want?

Thank you very much in advance.
-Chase
 
Wow, I'm surprised I actually figured this out. Ok, well, I solved my dilemma by moving the variables in the onunload function into the setActiveStyleSheet function, which sets the style sheet. So not only is setActiveStyleSheet setting the active style sheet, but it's also setting the cookie. Brilliant! The lack of responses really motivated me to figure this out on my own, so thanks! I hope this proves helpful to others in the future.
-Chase
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.