Solved

window.history  with frames

Posted on 1998-08-13
4
214 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
Comment Utility
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
Comment Utility
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 100 total points
Comment Utility
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
Comment Utility
any news adamr?
Did we help you, or do you need further assitence?
-Josh
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Avoid defining the variables in the global scope; trying to define them in a local function scope. Because:   • Look-up is performed every time a variable is accessed.   • Variables are resolved backwards from most specific to least specific scope…
I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
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…

771 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now