Using this sample code as an example: Go Back
<script>
function goBack() {
window.history.back();
}
</script>
Then, pressing this button will be the same as pressing the back button once on the browser.
However I would like to have a button that makes the back button pressed twice.
I tried window.history.back(-2);
but it doesnt work.
also tried window.history.go(-2);
but it doesnt give desired results.
I could have the button link back to the page but the reason why i want it to go back instead is so that previously entered data in a form is preserved.
Now
window.history.go(-2);
works; strange.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With