AJAX


AJAX stands for Asynchronous JavaScript and XML.

It is a JavaScript based technology that allows a web page to fetch new information and present itself without refreshing the page.

AJAX sample code
<!DOCTYPE html>
<html>
  <body>
    <div>
      <h1>Student Info</h1>
      <div id="studdiv"></div>
      <button type="button" onclick="loadDoc()">Change Content</button>
    </div>

    <script>
      function loadDoc() {
        var xhttp = new XMLHttpRequest();
        xhttp.onreadystatechange = function () {
          if (this.readyState == 4 && this.status == 200) {
            document.getElementById("studdiv").innerHTML = this.responseText;
          }
        };
        xhttp.open("GET", "/getstudent.php", true);
        xhttp.send();
      }
    </script>
  </body>
</html>