internet explorer 7 iframe unloads when going back

Posted by André on Stack Overflow See other posts from Stack Overflow or by André
Published on 2010-01-26T19:19:57Z Indexed on 2010/04/04 9:33 UTC
Read the original article Hit count: 284

Filed under:
|
|
|

Hi this is my first post here, so please be kind ;-)

i'm implementing a browser history manager, just like rsh or yui browser history manager.

The idea was not to constantly poll the url hash of a hidden iframe, but to capture the onscroll event of an iframe, when it scrolls to an anchor name on an urlhashchange.

So on every click i add an new anchor to iframe and set the iframe's hash to the anchors name. When pressing the back or forward button the frame scrolls to the previous or next anchor and the onscroll event is fired.

That works great on firefox 3.0+, IE6 and Opera but on IE7 when hiting the back button the frame unloads and loses all its anchors.

If anyone has an idea why this is happening or even a fix for this "bug", please i'm slowly going insane over this.

thanks in advance

btw the onscroll idea comes from: http://www.zachleat.com/web/2008/08/21/onhashchange-without-setinterval/

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about scroll