::::::::::::::::::::::::::
Home
Home Page
Method of generation of a code
Displays
Result of binding of the data
Systems of patterns of pages
Data acquisition without use XML
Data acquisition without use XML
Use JSON on the party of the client
Improved online shop
Review Ajax
Departure XMLHttpRequest
Processing of search servleta
 The search processing with help JavaScript
Problems of use Ajax
As it was more than once spoken, organization W3C is engaged mainly in development and creation of b
OASIS
Hands off PHP!
Automatic redirect (Auto Redirect) on PHP
Breaking of passwords becomes more accessible
Web2.0 Layout
Links
:::::::::::::::::::::::::

 

Review Ajax


Use Ajax begins with the JavaScript-object named XMLHttpRequest. As well as assumes a name, he allows to carry out HTTP-searches in a client part of your code and analyzes the answer of the XML-server. A first step in studying Ajax - creation of the data of object XMLHttpRequest. A method of report HTTP at use for search (GET or POST) and ways then are established in object XMLHttpRequest.


Now recollect, why "?" in word Ajax designates "asynchronous"? When you send HTTP-search, you do not want, that the browser has hung, expecting the answer of the server. Instead of it you want to react also to action of the user on page and to work with the answer of the server when that finally will come. To execute it, you need to register function of callback with help XMLHttpRequest and to send asynchronously search XMLHttpRequest. The control remain behind a browser, and function of callback will be called, when the answer of the server will come.


On the Web-server the search will come the same as also any another HttpServletRequest. After the analysis of parameters of search, servlet will execute all necessary actions for the application, serializuet his{its} search in format XML and enters it{him} in HttpServletResponse.


Coming back to the client, the function of callback registered in XMLHttpRequest, now is carried out to process the XML-document returned by the server. At last, the user interface is updated according to the data of the server, using a JavaScript-code for transformation of page.


Now, when you have review Ajax of a high level, I rassmotrju it{him} in more details at each step. Look at figure 1 if you suddenly will forget sequence of studying which is indistinct owing to asynchronous nature Ajax.