If you want to go to the previous page without knowing the url, you could use the new History api. history. back(); //Go to the previous page history. forward(); //Go to the next page in the stack history.go(index); //Where index could be 1, -1, 56, etc.
The Window History Object The history object contains the URLs visited by the user (in the browser window). The history object is a property of the window object.
Is it possible to get last page URL from the history object? I've come accross history.previous but that's either undefined or protected from what I've seen.
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