Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

window.history  with frames

Posted on 1998-08-13
4
Medium Priority
?
235 Views
Last Modified: 2006-11-17
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
Comment
Question by:adamr
  • 2
4 Comments
 
LVL 28

Expert Comment

by:sybe
ID: 1268249
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
 
LVL 8

Expert Comment

by:jbirk
ID: 1268250
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
 

Accepted Solution

by:
talklein earned 200 total points
ID: 1268251
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
 
LVL 8

Expert Comment

by:jbirk
ID: 1268252
any news adamr?
Did we help you, or do you need further assitence?
-Josh
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my daily work (mainly using ASP.net), I need to write a lot of JavaScript code. One of the most repetitive tasks I do are the jQuery Ajax calls. You know: (CODE) I don't know if for you it's the same, but for me is soooo tedious to write the …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question