Using FREE JavaScript Libraries

Rich Waters

Lifestyle Communities

Lots of choices!

Why bother?

Narrow down the choices


Most Popular

Prototype

Scriptaculous

Dojo

Moochikit

Yahoo User Interface

Hand writing Ajax vs. Prototype

Old Way

function createXHRRequest(url) {
  if (window.ActiveXObject) {
  	xhr = new ActiveXObject("Microsoft.XMLHTTP");
  } else if (window.XMLHttpRequest) {
  	xhr = new XMLHttpRequest();
  }
  xhr.open("GET", url);
  xhr.onreadystatechange = someResponseFunc();
  xhr.send(null);
}
function someResponseFunc() {
  if (xhr.readyState == 4){
    if (xhr.status == 200) {
      Do something with xhr.responseText
    }
  }
}

Hand writing Ajax vs. Prototype

Prototype

new Ajax.Request(url, {
  method: 'get',
  parameters: pars,
  onComplete: someResponseFunc
  });
function someResponseFunc(origRequest) {
  Do something with origRequest.responseText;
}

Bonus: Form.serialize('myform')

Examples from Domino

Demo's

Resources & More Info