...

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



aztech2000
08-24-2002, 03: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):

http://free.hostdepartment.com/pixelFusion/jscripttest/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/pixelFusion/jscripttest/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

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

Maybe try

history.back(1)

Though I doubt that would make a difference

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

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

aztech2000
08-24-2002, 03:26 PM
javascript:history.back(1);

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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum