How to "implement" back and forward buttons in an iframe with JS?
+5
A:
Use the window.history
object.
// For the current window
window.history.back();
window.history.forward();
// For an iframe's window
iframe.contentWindow.history.back();
iframe.contentWindow.history.forward();
or
iframe.contentWindow.history.go(-1); // back
iframe.contentWindow.history.go(1); // forward
Andy E
2010-07-15 11:14:55
The forward button doesn't work.(Firefox 4.0 and 3.5)
lam3r4370
2010-07-16 06:36:25
+2
A:
Button within frame:
<input type='button' value='Back' onclick='history.back()'>
Button within parent frame:
<input type='button' value='Back' onclick='frame_name.history.back()'>
Riateche
2010-07-15 11:18:14