I have a page, to which I POST information via form method="post"
. I would like to relaod it with JavaScript, but location.reload(true)
and location.reload()
makes browsers ask if I want to send the POST data again.
I would like to make JavaScript reload the page with GET instead of POST to skip the POST data.
How can I achieve that?
window.location.href = window.location.href
try
UPD:
there are other options as well:
window.history.replaceState(null, null, window.location.href);
window.location.href = window.location.pathname;
window.location.reload(true)
https://developer.mozilla.org/en-US/docs/Web/API/Location/reload