12.ajax

       1. ajax Overview

              AJAX asynchronous js and xml: asynchronous js and xml

              AJAX request is an asynchronous operation, the partial refresh operation can be completed in most cases within the same page.

              ajax is achieved by js. Wherein the asynchronous data request sent in xml format data.

              With the development of technology, ajax transmission and reception of the data format are the following:

                     xml     

                     json string

                     text plain text

              aj may be referred ajaj

       2. ajax operating principle

              Synchronous interaction:

                     Once the request after the request is issued, the browser must be in response to a result, it may continue to transmit, during the waiting, the browser can not carry out any operation.

              Asynchronous interaction:

                     Request is made, the browser can continue with additional operations do not have to wait for a response result, you can still send more requests. The server in turn responds to each request. In this process, the browser can be any action.

              . A practice scenario:

                     asynchronous:

                            Search box, registered - user name exists check

                     Synchronize:

                            Button after Baidu search box, there are two simultaneous requests that you need two servlet servlet file a return value and compare the value of compliance. This time in order to get the value returned to the same time using synchronous

              b. asynchronous request

                     advantage:

                            The user experience is good. Pressure reducing server access.

                     Disadvantages:

                   Increase server access pressure. malicious

Guess you like

Origin www.cnblogs.com/xuwangqi/p/11347551.html