Difference between revisions of "XMLHttpRequest"
Karl Jones (Talk | contribs) (→See also) |
Karl Jones (Talk | contribs) (→External links) |
||
Line 56: | Line 56: | ||
* [http://en.wikipedia.org/wiki/XMLHttpRequest XMLHttpRequest] @ Wikipedia | * [http://en.wikipedia.org/wiki/XMLHttpRequest XMLHttpRequest] @ Wikipedia | ||
+ | [[Category:Web design and development]] |
Latest revision as of 16:37, 17 March 2016
XMLHttpRequest (XHR) is an API available to web browser scripting languages such as JavaScript.
Contents
Description
XMLHttpRequest is used to send HTTP requests or HTTPS requests to a web server
The server response data is then received by the script, which can use the response data to update the Document Object Model.
The user does not submit the web page, nor does the browser request the entire web page.
Instead, XMLHttpRequest makes requests to the server (typically without the user's awareness), and displays the response in the browser.
This is the main principle of Ajax.
Browser support
Development versions of all major browsers support URI schemes beyond http and https, in particular, blob URLs are supported.
Various uses
Despite the name of the API, this data can be in the form of not only XML, but also JSON, HTML or plain text.
Processing the response data
The response data can evaluated and processed before displaying results. For example, if the data was formatted as JSON by the web server, it can be converted into a client-side data object as a convenience for further use.
Ajax
The Ajax web development technique used by many websites to implement responsive and dynamic web applications depends on XMLHttpRequest.
Same-origin policy
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.
See also
- Ajax (programming language)
- Application programming interface
- Client-side scripting
- Document Object Model
- JavaScript
- Hypertext Markup Language
- HTTP requests
- HTTPS request
- JSON
- Plain text
- Server response data
- Same-origin policy
- Scripting language
- Web browser
- Web server
- WebSocket
- XML
External links
- XMLHttpRequest @ Wikipedia