Forum Moderators: open

Message Too Old, No Replies

back button and frames

         

makzan

10:15 am on Jun 30, 2005 (gmt 0)

10+ Year Member



I'm using:
<a href="#" onClick="history.go(-1)" target="Main">back</a>
as a "back" link for my pages, except that the pages use frames and the back link is in a separate frame from the main frame. (I hope that makes sense)

Anyway, I have targeted the link to the Main frame, but when you click on the back button, it displays the frame that the back button is in, in the Main frame, instead of the previous Main page. If you click it again, then it works. If you click it again, it displays the "back" frame. Click again, and it works, etc etc.

I hope that makes sense.

I suppose the basic question is, can "back" links work with frames?!

Thanks

tedster

8:12 pm on Jun 30, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



When frames were introduced (back in the old days) browsers had a devil of a time integrating them into their history list finction. I'm not sure that, even today, the behavior is consistent.

I would avoid using a javascript back button link with a frame site. I don't think user expectations for its behavior would even be consistent.

aspnetapps

8:43 pm on Jun 30, 2005 (gmt 0)

10+ Year Member



You might try something like this:

<a href="javascript:parent.location.href='mypage.htm'">Go Back</a>

makzan

10:35 am on Jul 1, 2005 (gmt 0)

10+ Year Member



thanks, but does that not go back to "mypage" instead of the previous page?

aspnetapps

12:37 pm on Jul 1, 2005 (gmt 0)

10+ Year Member



Yes, you'll have to hard-code it that way if you don't want to use the history list. The history will always include any pages that were loaded, even in the frame. So your "Back" button will go to the previous in the list.