Interesting Back Button Bugs

By james

I didn’t mention these in the previous post (it was getting too long already), but there were some funky problems we ran into when dealing iframes for the back button. We were using an iframe so we expected that no matter what, if you leave a page and come back, the iframe will still contain the content it had when you left. This simple expectation failed in both ie and firefox for 2 different reasons.

IE:
It took us maybe a full day to figure the problem with IE and it STILL bothers me today because I cannot reliably reproduce the bug in isoloation. IE didn’t like doing ANY dhtml above the iframe that we were using. If ANY dhtml was done above the iframe, the iframe would be ‘reset’ to its original ’src’ when returning to the page via the back button. Sounds similar to the bug with safari that Brad Neuberg describes.

To get things rolling again in IE, we just moved the iframe to the very top of the page. That worked until just the other day. I decided to be fancy and use yahoo’s onDocumentReady implementation. Well I’m assuming they do some dhtml above the top of the body (maybe add script tags to the head?). Regardless, when I removed the yahoo files, the back button magically worked again.

Firefox:
We were seeing the EXACT same symptom: the iframe refused to remember its content. I couldn’t believe it…how did we break firefox’s new back button feature (where it stores the full state of the page including javascript and just restores it when you return…the uber back button fix). In the end, it wasn’t our code at all. We had firebug installed. All we did was disable firebug and the back button was as good as new. I can only suspect that firebug does some rigorous cache flushing or something.