How to "implement" back and forward buttons in an iframe with JS?
Use the window.history object.
window.history
// 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
https://developer.mozilla.org/en/dom/window.history
1.4m articles
1.4m replys
5 comments
57.0k users