Click to See Complete Forum and Search --> : [RESOLVED] AJAX Back Button with Hash


Shawazi
08-18-2008, 03:33 PM
I have an application without on page refresh, but am able to change things with the hash in the URL. This works perfect in FF and Safari, but in IE7 the back button will ignore the changes in the hash and just go back to the prior webpage. Does anyone know how to force the history stack to be pushed?

madwormer2
08-19-2008, 06:26 PM
I think that Gmail does it by having each link go to a new URL in an Iframe as well as doing the ajaxy things. IE will save each of these and add them to the history stack. Then it's up to you to handle what happens when each of these urls is accessed.

Shawazi
08-19-2008, 08:20 PM
thanks for the reply. forgot I post here, but you are completely correct. I used a fix located here:

http://weblogs.asp.net/bleroy/archive/2007/09/07/how-to-build-a-cross-browser-history-management-system.aspx in the section <update date="Sep. 14 2007">

I just use some browser detection to make that script and iframe be on the page or not. I'm glad IE8 will have the hash change event handler though.