1. Synchronous request: In the registration case we wrote before, after writing the user name, password, and other information in sequence, manually press the submit button, and then the data on the browser will be transmitted to the server to verify whether the user name is repeated, and then The browser prompts you with information about whether the user name is repeated. This method is slower and requires you to refresh the entire page after writing all the information and submit it to the server. If it does not pass the verification, you have to refill the information before submitting it, which is a waste of traffic. Secondly, if the verification is not passed, all the information will be lost and you have to fill it in again, which is too troublesome.
2. Asynchronous request: If using ajax, bind the user name text box to a mouse defocus event. In the event, use ajax to submit the user name to the server for verification. This verification is automatically sent to the server by the browser when our mouse leaves the user name text box. If you request verification, when we fill in other information, the server will send the verification information to the browser to prompt whether the information is repeated. This saves traffic and allows you to modify only the user name. All information can be submitted only after the final verification is passed. ;
All resources on this website are contributed and published by netizens, or reprinted by major download sites. Please check the integrity of the software yourself! All resources on this website are for learning and reference only. Please do not use them for commercial purposes, otherwise you will be responsible for all consequences incurred! If there is any infringement, please contact us to delete and remove it. Contact information: admin@php.cn