AJAX: Asynchronous JavaScript And XML

AJAX is way to program a web page to work faster and smarter by sending data while you're reading the page, without having to reload.

Examples

Sample

  var xmlHttp= new XMLHttpRequest(); // AJAX in newer browsers
  xmlHttp.onreadystatechange = function() {
    if (xmlHttp.readyState == 4) {
      try {
        if (xmlHttp.status == 200) {
          document.getElementById("ajax").innerHTML = xmlHttp.responseText;
        }
      }
      catch (e) {
        document.getElementById("ajax").innerHTML = "Error " + e.description;
      }
    }
  }
  xmlHttp.open("get","test.html"); 
  xmlHttp.send(null); 



What's Next?

blog comments powered by Disqus