Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

getting last page URL from history object - cross browser?

Tags:

People also ask

How do I find the URL of a previous page?

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.

Which object is used for displaying browser history?

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.