|
|||||||
Join now to share free website templates or post on the forum. If you have never been on a forum before read the
FAQ. It's quick, easy and free to join!
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Hello all,
I have this code in an iframe <FORM><INPUT TYPE="BUTTON" VALUE="Go Back" ONCLICK="history.go(-1)"></FORM> it works fine but i need it to taget another iframe on the page and change that iframe and go back in its own iframe Thanks in advance. |
|
||||
|
history - will only take you back from where you came from.
just change the code to suit your needs. this will take you to the iframe you specify. If you want it as a button, then use the form method. Code:
<a href="http://www.totheiframe.com" onMouseOver="window.status='Back to The Iframe You Go'; return true">Go Back</a> 1 out of 3 is a start.
__________________
Consultant - Programmer - WebMaster cleandeck - lawn mower undercoating wilmargraphite - graphite lubricants |
|
|||
|
Thanks so much. It saved my bacon. I've been beating my head against this wall for a good part of this last week and thanks to the info I got here, I can now move on to something more productive and enjoyable.
The best solution for me was to insert if (window.event) event.returnValue = false; just before the "return false; "statement. I understand the point you made about being reluctant to use browser specific code such as returnvalue, and I agree with that as a general principle. However, I think browser specific code is exactly the right and appropriate response to browser specific bugs. |
|
|||
|
if you give an iframe a name it becomes easy to target it
for example <iframe id="if1" name="frame1" src="iframe1/index.html" frameborder=0></iframe> alert(document.getElementById('if1').src) would give you 'iframe1/index.html' <iframe id="if2" name="frame2" src="iframe2/index.html" frameborder=0></iframe> alert(document.getElementById('if2').src) would give you 'iframe2/index.html' <a href="http://www.google.com" target="frame1">Google in frame 1</a> <a href="http://www.yahoo.com" target="frame2">Yahoo! in frame 2</a> Click these two links, alert(document.getElementById('if1').src) would give you 'http://www.google.com' alert(document.getElementById('if2').src) would give you 'http://www.yahoo.com' similarly, <a href="history.go(-1)" target=frame1,frame2>Step back in history</a> should go back in the iframes you desire.
__________________
Free Logo's Guarantee: Not satisfied with your logo? Claim 100% of your money back! |
![]() |
| Thread Tools | |
| Display Modes | |
|
|