www.webdeveloper.com
Results 1 to 7 of 7

Thread: history object

  1. #1
    Join Date
    Nov 2002
    Location
    Germany
    Posts
    4

    history object

    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

  2. #2
    Join Date
    Nov 2002
    Posts
    4,473

    Re: history object

    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.

  3. #3
    Join Date
    Nov 2002
    Location
    Germany
    Posts
    4
    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

  4. #4
    Join Date
    Nov 2002
    Posts
    4,473
    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.

  5. #5
    Join Date
    Nov 2002
    Location
    Germany
    Posts
    4
    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

  6. #6
    Join Date
    Nov 2002
    Posts
    4,473
    Originally posted by Silkeyes
    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 public specifications are a good thing (really, they are).

    I could not really implement a flawless navigation with either.
    Quite an undertaking.

    I thought I just missed some piece of JavaScript specification or something.
    No, they just lack a good one.

    So much for the rule:

    "When all else fails, read the directions".

  7. #7
    Join Date
    Nov 2002
    Location
    Germany
    Posts
    4
    I know that as the "rtfm" rule:

    read the f* manual. Often enough you want to say exactly that to a customer on the phone. ;-)
    3 most important people in my life :
    Me, myself and I

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles