Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Back in Iframes? 1

Status
Not open for further replies.

rageuser

Technical User
Feb 26, 2002
3
US
Hi there, I've constructed a site which has a main html popup and in this popup I load all the different sections of the site as iframes. - I was wondering if there is some way I can use a back command with Iframes. I've tried the javascript.history (-1) deal and that does not work. I need to jump back to the previous iframe, is this possible?
 
If you need to move back one frame in a particular frame you could use:

parent.framename.history.go(-1). That should do the trick. The only dumb questions are the ones that are never asked
 
That doesn't seem to work either. Maybe I'm doing something wrong. Here is the code I am using
Code:
<a href=&quot;#&quot; onClick=&quot;parent.framename.history.go(-1)&quot;>back</a>
These are Iframes so maybe that command only works on regular frames, I'm not really sure though I don't know much about frames. Thanks for your response!
 
unfortunately there is no way to be tacktful in these forums but I need to be clear. In this code you said you used,
<a href=&quot;#&quot; onClick=&quot;parent.framename.history.go(-1)&quot;>back</a>

you did use the actual name of the iframe like,

<a href=&quot;#&quot; onClick=&quot;parent.contentframe.history.go(-1)&quot;>back</a>

Sorry, but I just need to be clear.

The only dumb questions are the ones that are never asked
 
Do you mean the name of the Iframe the code is in? Say I have
Code:
<div id=home    blah blah>
do I put
Code:
<a href=&quot;#&quot; onClick=&quot;parent.home.history.go(-1)&quot;>
Or do I use the iframe src html file as the name
Code:
<a href=&quot;#&quot; onClick=&quot;parent.home.html.history.go(-1)&quot;>
Or do I have to assign a name to the iframe? Thanks for your help I do apologize for being a bit of a novice.
 
You use the name of the iframe you assigned.

<a href=&quot;#&quot; onClick=&quot;parent.home.history.go(-1)&quot;>

The above link will send your iframe named home back one frame in its history no matter what other frame you place the link, even if you place the link in the frame named home.


Happy coding
The only dumb questions are the ones that are never asked
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top