How to update the history of an iframe
I have a page with an iframe on it. I update the content of the iframe programatically. YES - I know that'开发者_JAVA百科s insane and bizarre - but please assume it as a given for the purposes of this question.
When I cause changes to the iframe, I'm not changing the src (think document.write), therefore it's not updating the history if the iframe, and when the user clicks the back button, it is sending the whole main page back. The behavior I desire is for it to treat each change to the iframe content as part of the history, so that when the user clicks "back" it reverts back to the previous content of the iframe.
Resisting the urge to bash iframes, or to question why I need this behavior, can anybody explain how to make changes to the iframe "register" as changes to it's history?
Thanks In Advance.
I think that you could do it by incrementing a number after a hash sign after each document.write
and have an array that contains the state for each number.
精彩评论