Skip to content
Advertisement

Going back to previous page using javascript

Is using JavaScript the most efficient way of navigating back to the previous page when a link or button is clicked?

What if JavaScript is disabled on the user’s end (Which most people don’t)?

Are there any known issues with cross-browsers? Are there any browsers that don’t support the history.back() function?

I am using this code to go back to the previous page:

<a href="javascript:history.back();">[Go Back]</a>

Advertisement

Answer

According to the Window history.back() documentation, all major browsers are supported

Advertisement