ajax is the difference between what the advantages of asynchronous and synchronous

ajax is what the advantages of asynchronous and synchronous difference

ajax (no refresh asynchronous technology)

What is ajax
xhr (xmlHttpRequest) want to target server sends a request and response data by using dom additions and deletions to change the way the page data
only for the server to return data we need, without returning the entire page, xhr instead of the browser to send and receiving the response.

ajax of three methods : post get ajax`

Advantages:
page does not refresh can receive data server response, to avoid blocking the browser
to update the page server to obtain information the way

Asynchronous : send and respond to interfere with each other, without blocking the browser
synchronization : must wait after the server processes the request, sends a response to the display, the browser will block

Default ajax is asynchronous, so the acceptance and implementation of the following methods of data do not conflict, do not wait until they have finished ajax execute the next method. If set to sync, you must wait for the ajax method executed, before the next method

The original interactive:
1, sends a request
2, the server receives the request, to the servlet process, respond by generating the servlet processing completion information
3, the browser information acquisition response, refresh the page, the page data display; (page refreshes)

Now interactions: (the XmlHttpRequest objects, a key)
. 1, xmlHttpRequest transmission request
2, the server receives the request, to the servlet process, respond by generating the servlet processing completion information
3, xmlHttpRequest subject receives data (data browser feel , xhr receive data)

Released three original articles · won praise 3 · Views 271

Guess you like

Origin blog.csdn.net/m0_46493091/article/details/105328152