Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Aug 2002
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    history object referenced from a frame??

    hi there..

    im trying to make a button within a frame and im no javascript master, but i thought this would be really easy.. any help is greatly appreciated..

    im quite sure the code i am using is correct, the problem seems to be more to do with referencing objects from within a frame.

    i have made up a small example..

    here is a simple html page(no frames):

    http://free.hostdepartment.com/pixel...test/intro.htm

    if u click the next link, then the back link you can see that in this case the history command is working..

    however, using the same code in this example below does not work:

    http://free.hostdepartment.com/pixel...est/intro2.htm

    after clicking next, the following page consists of two frames, in the bottom frame there is a "back" link using the code:

    <a href="javascript:history.go(-1);">back </a>

    i have a feeling it is not working because its in a frame..

    what i am ultimately trying to do is just replicate the user clicking their back button on the browser, by clicking this link.. it should ignore that there are frames and just go back to the last html page in the history, in this case intro2.htm.. hope that makes sense?

    have i incorrectly referenced the history object from the bottom frame?

    your help is greatly appreciated
    thanks heaps..
    damien

  • #2
    Senior Coder
    Join Date
    Aug 2002
    Posts
    3,467
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Works for me in IE6 on Windows 2000

    Maybe try

    history.back(1)

    Though I doubt that would make a difference

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Posts
    626
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Try: parent.history.go(-1)

    So that you are referencing the parent window rather than the one in the frame.

  • #4
    New to the CF scene
    Join Date
    Aug 2002
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    javascript:history.back(1);

    this code worked no problem in a html document but when executed from flash it didnt? really strange..


  •  

    Posting Permissions

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