View Full Version : Safari + document.write = ??? [fixed: Can you guess how?]

25 Feb 2007, 1:28 PM
I implemented the new theme switcher + lib switcher and it works great - except in Safari where it breaks everything. Apparently Safari doesn't like the document.write() calls and caches stuff? I don't know. Has anyone ever seen this kind of strange behavior? Just view any page in the example without a hard refresh in Safari and you will see what I mean.

I create a bogus form to post when the selects are changed (just for Safari) and that works. How, the links in the tree are links, and they don't work. Adding a timestamp to the end of the url also doesn't work. :(

26 Feb 2007, 7:17 AM
Safari is fixed. I had to move it all to the server side without including any server-side code in the examples. Can anyone guess how I did it?

26 Feb 2007, 7:49 AM
lol, this should be interesting... anyone?

26 Feb 2007, 5:08 PM
Maybe thats what those 2 new odd php files are on the deploy directory? swap and preswap

27 Feb 2007, 8:08 AM
You are on the right track Aaron.

I used a .htaccess file to to change .html files to be processing as php. In that same .htaccess I auto prepend preswap.php which starts a buffer, and I auto append swap.php which gets that buffer and manipulates it based on user selections. This way I still have static HTML files for the download and on the server I can have some fun. :)