Asynchronous JavaScript and XML.
From within JavaScript, you can send HTTP or HTTPS calls directly to a web server and load the server response data directly back into the script thus avoiding the page refreshes to get the server response.
Reference: XMLHttpRequest - Wiki
XMLHttpRequest.
XMLHttpRequest is subject to the browser's same origin policy in that, for security reasons, requests will only succeed if they are made to the same server that served the original web page. There are alternative ways to circumvent this policy if required.
Reference: XMLHttpRequest - Wiki
- Create an XMLHttpRequest object
- Initialize the object by invoking it's open method
- Send an HTTP request by invoking it's send method
- Check the readystate, status of the AJAX request through XMLHttpRequest object's onreadystatechange event listener
- When readystate is 4 and status is 200, process the response
- readystate (0:uninitiated, 1:loading, 2:loaded, 3:interactive, 4:complete)
- responsetext (Returns response data as a string)
- responseXML (Returns response data as XML)
- status (status of the request by number - 200, 304, 403, 404)
- statusText (status of the request by name - "ok"(for 200),"Not modified" (for 304), "Forbidden" (for 403), "Not Found" (for 404)
- contentType (helps to set/get the content type explicitly)
- timeout (time allowed for the request to complete)
Read more: http://www.javareference.com/jrexamples/viewexample.jsp?id=111
- abort()
- open(method, url, [[async], [username], [password])
- send(data)
- getResponseHeader(header)
- getAllResponseHeaders()
- setRequestHeader(header, value)
Read more: http://www.javareference.com/jrexamples/viewexample.jsp?id=111
- onreadystatechange
- onerror
- onload
- onprogress
- ontimeout
Read more: http://www.javareference.com/jrexamples/viewexample.jsp?id=111