View Full Version : history object referenced from a frame??

08-24-2002, 04:50 AM
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):


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:


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..

08-24-2002, 05:40 AM
Works for me in IE6 on Windows 2000

Maybe try


Though I doubt that would make a difference

08-24-2002, 06:12 AM
Try: parent.history.go(-1)

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

08-24-2002, 04:26 PM

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