Recently registered in writing Www.doubilaile.com's login. Need to use AJAX to request the server to determine whether the user name exists, the user name and password match, and then submit the data. The problem is that an asynchronous request can successfully return data, but that data cannot be relied upon for immediate judgment. My understanding now is that the asynchronous request goes to the server side, and the local code is still executing down. The server data does eventually come back, but the local judgment is done. So the password box will appear after the individual blur can be submitted, and the direct submit button to press two times to submit the problem. Resolves the synchronization to an asynchronous problem. The understanding is that the synchronization will wait for the server data to return before continuing to execute, so the returned data can be used as a basis for judging, as long as the conditions are met, the form is naturally successfully submitted.
Using AJAX synchronous request to solve the problem that login registration needs to be judged by the server return data