How to reload page with javascript without sending POST information again

To reload a page without post data using javascript the easiest way I've found is to use an extra form to submit - this works regardless of whether the url is # or anything.

<form name="reloadForm">
    <button type="submit">
        Continue
    </button>
</form>
<script>
    document.reloadForm.submit() ;
</script>

That will show a button briefly on screen that the user can click continue on but the script will automatically submit it - this method sorts out a number of problems - the form is empty so it will not submit any post data (the button isn't named so even that won't submit a value). It works even if the url is set to #, and finally it gives a backup in case the user has disabled javascript (or the javascript doesn't work for some reason) they've still got a continue button available to click.


window.location.href = window.location.href

try