In the Ajax. Open method, 3rd parameters are set to synchronous or asynchronous.
JS class libraries such as prototype are generally asynchronous by default, that is, set to true. JS will wait for the request to return and get the status.
(The synchronous or Asynchronous Method of this method depends on the 3rd parameters in the open method. This method will not be returned until the request is completed or times out. If it is true, this method will be returned immediately. )
Onreadystatechange event handler is not required. While asynchronous processing requires onreadystatechange event processing, and the value is 4, and then the following content is processed correctly.
Synchronization: submit a request, wait for the server to process, and return the result. The client browser cannot do anything during this period.
Asynchronous: requests are triggered through events-> server processing (this is what the browser can do)-> processing is complete
Main uses of Ajax: asynchronous transmission, partial update, and aggregation