Handy Notes 1 2018/04/23 Basic understanding of Ajax

1. What is ajax?

   The main purpose is to realize the asynchronous communication between the client and the server, and realize the partial refresh of the page.

2. Synchronous and Asynchronous!

   Synchronization: When multiple threads send requests to a data at the same time, A must be executed before it can be sent to B. There will be a blocking situation, but it is thread-safe and avoids deadlock.

  Asynchronous: When multiple threads want to send a data request at the same time, although the resource is given to A, B can also access it, so the efficiency is higher than that of synchronization

3. Ajax execution process

 1). Create a XMLHttpRequets

 2). Create a new HTTP request and specify the request method, already URL

 3). Set the function that responds to the request HTTP request status

 4). Send the request

 5). Get the data returned by the asynchronous call

 6). Implement partial refresh through javaScript and DOM

Case, understood through a native ajax (added on 4/23)

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324732862&siteId=291194637