AJAX means Asynchronous JavaScript and XML and it is a group of inter-related technologies like javascript, dom, xml etc.
AJAX is used to make site or page more interactive and fast.
without reloading the web page, you can send and receive data asynchronously
we can create fast and dynamic web pages by using AJAX.
Example
<!DOCTYPE html>
<html>
<body>
<div id="demo"><h2>Let AJAX change this text</h2></div>
<button type="button" onclick="Done()">Change Content</button>
<script>
function Done() {
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (xhttp.readyState == 4 && xhttp.status == 200) {
document.getElementById("demo").innerHTML = xhttp.responseText;
}
}
xhttp.open("GET", "ajax_info.txt", true);
xhttp.send();
}
</script>
</body>
</html>
0 Comment(s)