Women in Technology

Hear us Roar

  AJAX: How to Handle Bookmarks and Back Buttons
Subject:   Doesn't work in IE after a popup window
Date:   2006-08-16 14:57:23
From:   koehn
I'm using IE 6.0.2900, and for some reason after a popup window IE won't preserve the historyStorage iframe.

If I turn on debugging, I can see my code inserting data into the iframe, but if I open a popup window (created with window.open()), link away (from the main window), and hit the back button, the iframe is empty when I return, and dhtmlHistory.isFirstLoad() returns false.

My popup window doesn't use dhtmlHistory at all.

Otherwise, it's been a wonderful utility.

Full Threads Oldest First

Showing messages 1 through 1 of 1.

  • Doesn't work in IE after a popup window
    2006-09-19 00:34:22  PJones [View]

    I had a similar problem, which broke dhtmlHistory after viewing a pdf or image in a popup window.

    I found that after the popup window, when pressing the back button, the browser actually requested the page from the server rather than using its cache. When it re-requests the page from the server, the historyStorage is reset to empty, which prevents dhtmlHistory from working.

    To fix this, I set the http Expires header for the page to a time in the future. (Previously we had a Expires : 0 in the header). This ensures the cached version of the page is used, which keeps the historyStorage intact and dhtmlHistory working.

    This exact fix may not work for you. Your server may return other headers which may also cause problems.