AJAX
AJAX
AJAX is a misleading name. AJAX applications might use XML to transport data,
but it is equally common to transport data as plain text or JSON text.
or
<!DOCTYPE html>
<html>
<body>
<div id="demo">
</div>
<script>
function loadDoc() {
xhttp.onreadystatechange = function() {
document.getElementById("demo").innerHTML =
this.responseText;
}};
xhttp.send();
}</script>
</body>
</html>
The XMLHttpRequest Object
All modern browsers support the XMLHttpRequest object.
The XMLHttpRequest object can be used to exchange data with a server behind
the scenes. This means that it is possible to update parts of a web page,
without reloading the whole page.
Example
var xhttp = new XMLHttpRequest();
Method Description
Property Description