开发者

internet explorer 7 iframe unloads when going back

开发者 https://www.devze.com 2022-12-17 23:39 出处:网络
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

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 press开发者_运维百科ing 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.

Does anyone have an idea why this is happening or have a fix for this "bug"?

BTW the onscroll idea comes from this page.


You might get some mileage from the DOJO toolkit which seems to have some workarounds for IE7 http://o.dojotoolkit.org/forum/dojo-core-dojo-0-9/dojo-core-development-discussion/dojo-hash-cross-browser-html5-onhashchange

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号