Home >Web Front-end >JS Tutorial >How to deal with the forced refresh of the Form submission page
This time I will show you how to deal with the forced refresh of the submitted Form form page, and solve the problem of forced refresh of the submitted Form form page. What are the precautions?The following is a practical case, let's take a look .
It took me a long time to click submitButton I added a type="button"
It turned out to be <form > <button id=" sub" /> Problem
//在记一个坑(刚学前台,不是很懂,项目中自己给自己挖了个坑,哈哈...)When there is a button tag in the form, after the form is submitted asynchronously using ajax, the page will be refreshed. (It feels very weird) Cause: When the button exists, the form will be submitted again, so the page is refreshed. (Previously thought button type='submit' ) button has the function of submitting the form. Solution: Just replace the button label with a label
. Modify
Recommended reading:
How to deal with ajax cross-domain access error 501
Use Ajax to increase data based on the human resources system OA account method
The above is the detailed content of How to deal with the forced refresh of the Form submission page. For more information, please follow other related articles on the PHP Chinese website!