Question

I use window.location.reload(); on my page.

But in Chrome it do not re-send form data.

Standart browser refresh, ask about resending. FF and Opera works fine.

Is there some cross-browser solution?

Was it helpful?

Solution

Try (BAD ANSWER, SOLUTION BELOW)

window.location.reload(true);

SOLUTION :

Bad answer after research, sorry. The only solution consists to create an hidden form with method post and simulate a submit on this form ;)

<form action="?" method="POST" style="display:none" id="myform">
<input type="text" name="mydata" value="myvalue" />
</form>
<script>
;$(function() {
  $('#myform').trigger('submit');
});
</script>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top