Make an iframe go back?
Moderator: General Moderators
Make an iframe go back?
I'm trying to get an iframe (and not the whole webpage) to go back, like history(-1). Everything I've tried hasn't worked. Could someone show me a working example?
- Kieran Huggins
- DevNet Master
- Posts: 3635
- Joined: Wed Dec 06, 2006 4:14 pm
- Location: Toronto, Canada
- Contact:
I'll give some more details.
I have an iframe with a name and id of "o". The following things don't work:Am I doing it wrong?
I have an iframe with a name and id of "o". The following things don't work:
Code: Select all
<a href="#" onclick="window.frames.o.history.go(-1);">back</a>
<a href="#" onclick="window.frames.o.history.back();">back</a>
<a href="#" onclick="window.frames['o'].history.back();">back</a>
- Ollie Saunders
- DevNet Master
- Posts: 3179
- Joined: Tue May 24, 2005 6:01 pm
- Location: UK
how about something along the lines of
Code: Select all
document.getElementsByTagName('IFRAME')[0].history.go(-1);- Ollie Saunders
- DevNet Master
- Posts: 3179
- Joined: Tue May 24, 2005 6:01 pm
- Location: UK
- Kieran Huggins
- DevNet Master
- Posts: 3635
- Joined: Wed Dec 06, 2006 4:14 pm
- Location: Toronto, Canada
- Contact:
Code: Select all
parent.frames[0].history.back()