How to make history.back() without getting a warning on the browser to reload the page?

I need to create a “Back” button, so for that I used:

history.back();

It works fine when I run it locally, but when I deploy it to the server when I click on the button I get a message on the browser:

Confirm Form Resubmission
This webpage requires data that you entered earlier in order to be properly displayed. You can send this data again, but by doing so you will repeat any action this page previously performed.

Press the reload button to resubmit the data needed to load the page.
ERR_CACHE_MISS

There is no problem resubmitting the form. I just want to avoid this message for the user. Is there any way to do that?

Leave a Comment