Jsp pages of asynchronous and synchronous

"Asynchronous" request is opposed to "sync" in terms of the request, there is a lot of operations are "asynchronous" and "synchronous" one said, "synchronous" means that you initiate an action program needs to wait until the operation is complete the program can proceed to the next step. Asynchronous operation is that you start a program can continue to follow-up work before the operation is complete, when the operation is completed, the triggering event processing operations or uses a callback to complete the formalities.
In general asynchronous operations are to start a new thread to handle your request, call your designated after the completion of the callback function to complete the asynchronous operation.

1 <a href="" onclick="number_jian(${b.id})" id="decrement">-</a>
2 <input type="text" class="kongge" onfocus=this.blur() value="${b.num}">        

 

. 1  function number_add (ID) {
 2      NUM = var. 1 ;
 . 3      var ID = ID;
 . 4      window.location.href = "/ Happy-Farm / Cart / findLandCartList3 landID =?" + + ID '= & Number' + NUM;
 . 5      / / $ ( "kongge.") the Click ();.
 6      // add event execution browser default action, that is, after the following events must be performed, the page will refresh 
7      . $ (. "kongge") the Trigger ( "the Click " ) .focus ();
 . 8      // Alert (" plus the - current number + "+ NUM); 
. 9 }

Jsp requests generally you will hit an address from the address bar, or submit form form the way, this page will be refreshed. But if you send an ajax request in jsp page, then, in front of two different, the background will return to the jsp page content, not directly refresh the page, you can return data written on the page div, thus completing the page partial refresh.
After For example, you do a query function, query and query result display area on the page, when you can point the query button you send your query via ajax asynchronous, and you get the results back to return, update your jsp page of search results, jsp other parts, such as the query conditions have not been updated, jsp not refreshed, but updated results this piece of content.

Guess you like

Origin www.cnblogs.com/smart-fox/p/11372924.html