• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 239
  • Last Modified:

window.history with frames

I've been trying to do the following in VBscript, but there's no vbscript section here... so maybe javascript's the way to go:)...
I have two frames... a menu (bottom frame) and a content frame (top frame).  In the menu, I have a "back" button... this button should use: window.history back 1 and target that to the top frame.  I've tried this a bunch of different ways- but I can't seem to have the top frame update with the last URL in the browser's history list.

any help would be most appreciated.

TIA,
Adam
0
adamr
Asked:
adamr
  • 2
1 Solution
 
sybeCommented:
If you want the top frame to display the previous document that was in the bottom using history, i think that is not possible.
For security reasons history elements can not be read, and can not be transferred from one frame to another.

So if you want to find out where the visitors from your website came from, you can't do that using history.
0
 
jbirkCommented:
did you try simply using "history.go(-1);"?  This will go back one in the history list.  However if that is just a change of the contents of one frame it will only change that one frame and not the entire document.  If you wanted to go further back in order to get past that frame activity you could use history.go(-2) or -3 or however many is necesary, but you can't see the value of the urls in the history if they came from a different url for security reasons as sybe has pointed out.

You can use document.referrer to get where the user linked to you from.  And with that you could set "top.location=top.document.referrer;" to go back, but this will only work if they linked to your page.  If they typed it in or used a bookmark document.referrer is empty.
-Josh
0
 
talkleinCommented:
here is the script for this buttons (Back and Forward).
(you can put just one button.)
then you can put the code of any button (change the FRAME TARGET NAME to the name of your frame).


<FORM>

<INPUT TYPE="button" VALUE="BACK" onClick="parent.FRAME TARGET NAME.history.back()">

<INPUT TYPE="button" VALUE="FORWARD" onClick="parent.FRAME TARGET NAME.history.forward()">




tal.





0
 
jbirkCommented:
any news adamr?
Did we help you, or do you need further assitence?
-Josh
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now