Sunday, 4 January 2015

AJAX AND JAVASCRIPT

Ajax work with javascript in Four steps:

AJAX - XMLHTTP REQUEST
AJAX - Send a Request To a Server
AJAX - Server Response
AJAX - The onreadystatechange Event

Read more...

AJAX - xml http request


The XMLHttpRequest object all modern browsers support the XMLHttpRequest object (IE5 and IE6 use an ActiveXObject).The XMLHttpRequest object is used to exchange data with a server behind the scenes.....

Read more...

AJAX - Send a Request To a Server


The XMLHttpRequest object is used to exchange data with a server.To send a request to a server, we use the open() and send() methods of the XMLHttpRequest object....

Read more...

GET or POST:

GET is simpler and faster than POST, and can be used in most cases. However, always use POST requests when. cached file is not an option (update a file or database on the server) Sending a large amount of data to the server (POST has no size limitations) Sending user input (which can contain unknown characters), POST is more robust and secure than GET...

Read more...


Async=false

To use async=false, change the third parameter in the open() method to false.Using async=false is not recommended, but for a few small requests this can be ok.Remember that the JavaScript will NOT continue to...

Read more...


AJAX - Server Response


To get the response from a server, use the responseText or responseXML property of the XMLHttpRequest object.\

ResponseText

ResponseXML


AJAX - The onreadystatechange Event


When a request to a server is sent, we want to perform some actions based on the response.
The onreadystatecha


Using a Callback Function


A callback function is a function passed as a parameter to another function.
If you have more than one AJAX task on your website, you should create ONE standard function for creating the XMLHttpRequest object, and call this for each AJAX task.



No comments:

Post a Comment