Ajax

Tim Topper

Yukon College

Not the cleanser...

Not the legendary warrior...

Source: http://www.factmonster.com/ce6/ent/A0802924.html

The abbreviation

Picture of Jesse James Garrett

Which stands for

Does Ajax have anything to do with usability?

Pre-Ajax: Sun ONE Calendar

Screenshot of Sun ONE Calendar

Post-Ajax: Flickr

Screenshot of Flickr

Development life

1972-75 WATFIV, FORTRAN G and H TI minicomputer
1976 WATFIV System 370
1977-1981 WATFIV, Pascal, GPSS, Simscript, APL, SAS System 370 (using terminals)
1981-1982 C Z80 single board
1983 SAS YTG mainframe
1982-1985 Pascal Apple II and IBM PC
1984-1986 FORTH Macintosh
1986-1990 C, C++, awk, Perl DEC Ultrix on DEC GPX
1991-1992 Pascal IBM PC
1992-Present C++, Perl MS OSes
1994-Present HTML, XHTML, XML, XSLT, Javascript, CSS, Python Windows and Linux

2004: XMLHTTPRequest

try {
 var xhr = new XMLHttpRequest();
}
catch (error) {
 try {
   var xhr = new ActiveXObject("Microsoft.XMLHTTP");
 }
 catch (error) {
   return false;
 }
}

xhr.open("GET", "/feed.xml", true);
xhr.send(null);

function stateHandler() {
 if (xhr.readyState == 4) {
  if (xhr.status == 200) {
   success();
  }
  else {
   failure();
  }
 }
 return true;
}

Some pages with very simple examples are http://www.sitepoint.com/article/remote-scripting-ajax, http://rajshekhar.net/blog/archives/85-Rasmus-30-second-AJAX-Tutorial.html, http://www.powazek.com/2005/05/000520.html and http://www.robsanheim.com/Ajax/pages/xhr/xhrSimple.jsp;jsessionid=43F620EC02A45A4B5016419BBBBEE161

2005: Hype?

Small collage of Ajax headlines from Business 2.0, IBM Developerworks and CNet

2005: Loads of applications

2005: Libraries

A list of Ajax libraries can be found at the end of the Wikipedia article on Ajax.

Another list is maintained by the Open source applications foundation.

2005: Books

Image of book cover of Pragmatic Ajax Image of book cover of Foundations of Ajax

URL for Pragamatic Ajax is http://www.ajaxian.com/archives/2005/10/pragmatic_ajax_1.html

URL for Foundations of Ajax is http://www.apress.com/book/bookDisplay.html?bID=10042

What is Ajax?

Why web-based applications?

Other Web-app/Rich-client technologies

Excellent review at http://www.ajaxinfo.com/default~viewart~8.htm (which is the source for the image).

So before ...

Remind me again: What exactly is Ajax?

XHTML

XHTML Summary

CSS

CSS: Summmary

Javascript

Javascript example: show-hide tricks

Javascript example: script.aculo.us

Javascript example: S5

Javascript example: GAP

Javascript example: Tiddlywiki

Javascript: Summary

XMLHTTPRequest

AJAX: The whole picture

Model : XHTML
View : CSS
Controller : Javascript
Persistence : XMLHTTPRequest
to a back end datastore

Classic request-response cycle

Image source: Ajax: A New Approach to Web Applications by Jesse James Garrett at http://www.adaptivepath.com/publications/essays/archives/000385.php

Ajax request-response cycle

Image source: Ajax: A New Approach to Web Applications by Jesse James Garrett at http://www.adaptivepath.com/publications/essays/archives/000385.php

Ajax Example: Apple Store

URL: http://store.apple.com/

Ajax Example: Google suggest

URL: http://www.google.com/webhp?complete=1&hl=en

Ajax Example: Ta-da lists

URL: http://tadalist.com

Ajax Example: Monket Calendar

URL: http://www.monket.net/cal/

Ajax Example: Num sum spreadsheet

URL: http://numsum.com/

Ajax Example: Writely

URL: http://www.writely.com/

Paul Kedrosky wants more

Source: http://paul.kedrosky.com/archives/001797.html

Ajax Example: Netvibes

URL: http://www.netvibes.com/

Ajax Example: Google maps

URL: http://maps.google.com

Ajax Example: Webnote

URL: http://www.aypwip.org/webnote/

Gotchas

  • Back handled via hidden iframes that insert into browser history or callbacks triggered by pressing back key.
  • Use Javascript to update URL fragment identifier to enable bookmarking.

Ajaxian design

Ajaxian design

Future Ajax

Resources list

URL: Ajaxian blog = http://www.ajaxian.com/

URL: Wikipedia page = http://en.wikipedia.org/wiki/Ajax_%28programming%29

URL: Pragmatic Ajax (book) = http://www.ajaxian.com/archives/2005/10/pragmatic_ajax_1.html

URl: Foundations of Ajax (book) = http://www.apress.com/book/bookDisplay.html?bID=10042

Browser support

  • Browsers that support Ajax
    • Apple Safari 1.2 and above
    • Konqueror
    • Microsoft Internet Explorer (and derived browsers) 4.0 and above
    • Mozilla Firefox (and derived browsers) 1.0 and above
    • Netscape 7.1 and above
    • Opera 7.6 and above