0% found this document useful (0 votes)
41 views

XML HTTP Request & Ajax

XMLHttpRequest is a JavaScript API that allows sending HTTP requests directly to a server and loading the response into a script without reloading the page. It receives data from the server that can alter the DOM or be evaluated by scripts, and plays an important role in Ajax techniques used by many modern websites to build dynamic applications. The onreadystatechange property stores a callback function to monitor request status changes, while readyState indicates the status from uninitialized to complete.

Uploaded by

Prithvi Ramola
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
41 views

XML HTTP Request & Ajax

XMLHttpRequest is a JavaScript API that allows sending HTTP requests directly to a server and loading the response into a script without reloading the page. It receives data from the server that can alter the DOM or be evaluated by scripts, and plays an important role in Ajax techniques used by many modern websites to build dynamic applications. The onreadystatechange property stores a callback function to monitor request status changes, while readyState indicates the status from uninitialized to complete.

Uploaded by

Prithvi Ramola
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 1

XMLHttpRequest (XHR) is an API (Application programming interface) available in web browser scripting languages such as JavaScript.

It is used to send HTTP or HTTPS requests directly to a web server and load the server response data directly back into the script. The data might be received from the server as XML text or as plain text. Data from the response can be used directly to alter the DOM of the currently active document in the browser window without loading a new web page document. The response data can also be evaluated by client-side scripting. For example, if it was formatted as JSON by the web server, it can easily be converted into a client-side data object for further use.
XMLHttpRequest has an important role in the Ajax web development technique. It is currently used by many websites to implement responsive and dynamic web applications. Examples of these web applications include Gmail, Google Maps, Facebook and many others.

Property Onreadystatechange readyState

Description Stores a function (or the name of a function) to be called automatically each time the readyState property changes Holds the status of the XMLHttpRequest. Changes from 0 to 4: 0: request not initialized 1: server connection established 2: request received 3: processing request 4: request finished and response is ready status 200: "OK" 404: Page not found

You might also like