Go Back to previous page code isn't working

I’m using this code to allow page visitors to return to the previous page, without succes.
Any help will be appreciated.

<script>
function goBack() {
    window.history.back();
}
</script>
</head>
........

<body>
.....

<button onclick="goBack()"> Return To Previous Page</button>

.....

Does this help?

1 Like

Thanks, but after trying those suggestions, still no success.
Any additional help is appreciated

It works for me :slight_smile:

Try temporarily changing the function to this and see what’s in the console.

function goBack() {
//    window.history.back(); 
  console.log(window.history.length); 
}

More than 1 ?

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.