XMLHttpRequest

From Wiki @ Karl Jones dot com
Revision as of 12:38, 24 May 2015 by Karl Jones (Talk | contribs) (First)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

XMLHttpRequest (XHR) is an API available to web browser scripting languages such as JavaScript.

It is used to send HTTP or HTTPS requests to a web server and load the server response data back into the script.

Development versions of all major browsers support URI schemes beyond http and https, in particular, blob URLs are supported.

Data from the response can be used to alter the current document in the browser window without loading a new web page

Despite the name of the API, this data can be in the form of not only XML, but also JSON, HTML or plain text.

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 be converted into a client-side data object for further use.

The Ajax web development technique used by many websites to implement responsive and dynamic web applications depends on XMLHttpRequest.

For security reasons, XMLHttpRequest requests follow the browser's same-origin policy, and will therefore only succeed if they are made to the host that served the original web page.

External links