First, the page is loaded for the first time. If no operation is performed and the form has not been submitted, click F5 to refresh. There is no problem.
F5 refresh causes repeated form submission
Prerequisites:
The user has passed
(1) submit button
(2) form submitted by form. Submit () in Js.
(3) I don't know about other methods. I hope you can tell me what you want.
A form is submitted.
Based on the form submission method, you can view two situations after the form is submitted,
Get: in the address bar, you can see the page address bar changes:
? The following parameters are passed when the form is submitted. There is no doubt that these parameters will be resubmitted during F5 refresh.
Post: Open the developer tool in chrome to view the data submitted by the form.
It can be seen that when F5 is refreshed, data will be re-submitted.
As for the post submission method, the browser will prompt
Because the "Standard Convention" post will change the server data, but the get method will not. In fact, whether it is get or post, how the server operates the data on the server after receiving parameters is a problem on the server and is irrelevant to the client.
Why does F5 refresh cause repeated form submission?