I am doing a project in RoR. That project is inside a iFrame. In that iframe have forward and back button. When I click backward button, the iframe content should go back bu
you may like to use the window.history
object
iframe.contentWindow.history.go(-1); // back
iframe.contentWindow.history.go(1); // forward
so your back button can be modified as \
$('#back-btn').on('click', function () {
iframe.contentWindow.history.go(-1);
or
iframe.contentWindow.history.back();
});
and your forward button can be modified as
$('#forward-btn').on('click', function () {
iframe.contentWindow.history.forward();
or
iframe.contentWindow.history.go(1);
});
Cheers !