I have a general question about the history object in JavaScript.
Assume having a page with 4 frames like left-up, right-up, left-down and right-down.
Each of these frames does contain different information and you can browse each for some time.
Now after I went through them all. What does happen if I click on the browser's back button ? Is it the same as if I said top.document.history.back() in JavaScript ?
The question I am asking is this:
How do histories of frames get included into the containing frame's history ?
Thanks for any input.
3 most important people in my life :
Me, myself and I
Originally posted by Silkeyes Is it the same as if I said top.document.history.back() in JavaScript ?
Documents don't have a history object. If it works, it's probably in IE. Microsoft lets anything work. According to the documentation at http://msdn.microsoft.com/workshop/a...j_history.asp, only windows have history objects.
Oops, my fault ! You are totally right about documents having no history object.
Since windows however have my question is still valid. The 4 frame example consists of 5 windows, containing frame and the 4 single frames, or do I get that wrong as well ?
Now which history object does the back button of a browser use or should use ? Is there any specification on that matter ?
3 most important people in my life :
Me, myself and I
I did not see anything that explained how the history worked in frames. Since there is no public specification oon how it is supposed to work, you would have to peruse the particular browser's specification to find out how the back button is implemented. It may be connected to "physical" windows and not to individual frames. Since security restrictions prevent you from seeing the window history, there isn't much of a way to just dump it out to see what it contains. Some experimentation on your part could yield your answer.
Well I HAVE experimented with that one (that was needed for a multi-frame homepage and navigation). The sad thing (well first it made me angry, then furious in the end just sad) is that every browser does it another way. Sometimes you go back with the back button and just the latest change of a frame is taken into account, some other browser would change all at the same time. The real "fun" was to discover that it's not just manufacturer specific but even the versions do differ on handling that and while I could live with what IE 6 and Netscape 4 & 7 did, it was just a mess with Netscape 6. Sometimes going back in single frames would jam the history of it so badly you couldn't navigate at all, not even with the browser's own buttons. Opera and Mozilla did something in between, I could not really implement a flawless navigation with either. I thought I just missed some piece of JavaScript specification or something.
Thanks for your input, it was highly appreciated.
3 most important people in my life :
Me, myself and I
Bookmarks