AJAX

Is it Just a Buzz Word?

Bryan Mills

University of Pittsburgh

What is AJAX?

  • Term only a year old
  • Like LAMP made up of several technologies

Why should you care?

Who Cares About AJAX

What is it?

Whats it look like?

Is this stuff new?

Why all the buzz?

Traditional Model

Asynchronous what?

How do we do this?

if (window.XMLHttpRequest) {
    var req = new XMLHttpRequest();
    req.onreadystatechange = requestHandler;
    req.open("GET", "/somefile.xml", true);
    req.send("");
}
function requestHandler() {
    if (req.readyState == 4) { 
       alert(req.statusText);
       req.responseXML.getElementById(blah);
    }
}

NOTE: IE uses a different name for the object.

req = new ActiveXOjbect("Microsoft.XMLHTTP");

Much more information available.

This example doesn't work in IE. You must check for IE and if so set differently.

Does it have to XML responses?

Example

The Bad Stuff

Options anyone?

Libraries

Is it more than buzz?

Thank You!

Questions?

bryan@mills1.net