Domanda

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?

È stato utile?

Soluzione

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>
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top