Intro
- What is AJAX?
- Heart is XHR
- AJAX is a marketing term describing use of XHR optionally with orthogonal technologies such as drag + drop, et al...
- History (concepts, before and after ajax)
- Updating content without user interaction
- Before: Reload the page via JavaScript or Meta Refresh html tag
- After: Asynchronous (behind the scenes) data querying.
- Dynamic user interface
- Heavy server-side generation of user interface.
- Lightweight, faster-feeling interfaces1
XHR: xmlhttprequest object
- Invented by Microsoft
- Not standardized
- Widely implemented. IE, Opera, Safari, and Mozilla have this.
- Today: Quite common feature of any browser with even small market presence.
**http://barcamp.org/FastAJAX
* Technologies worth knowing
o HTTP
o HTML
o DOM
o XML?
o JSON
* How it works
o Asynchronous request.
o Same old HTTP (Get, Post, etc)
HTTP transport mechanism without reloading the page.
NOT strictly XML; any format will do.
XML, HTML, JSON: 3 popular formats for data
XML is familiar.
HTML is familiar.
JSON is javascript literal object notation eg:
myobject = {
'properties' : 'hello',
attributes : 'world',
go : function () { alert(this.properties + ' ' + this.attributes) }
}
**
Eval it and you can get complex interactions.
Sessions and cookies work as you would normally expect on a normal webpage.
Benefits:
Faster, lighter interactions. Less weary on users. Do more with less.
Faster implementation??
Disadvantages:
Potentially dangerous, easily confounded, won't work without javascript,
inaccessibility problems, UI abuse eg breaking the back button.
References:
http://barcamp.org/FindPage?SearchFor=Ajax
http://barcamp.org/10SecondAjax
Put your hcard on a map. Instant Disposable Map
http://www.nearwhere.com/guest/
Mashup of ski resorts and hotels.
http://skiwhere.com/map/
Excellent XHR intro
http://jibbering.com/2002/4/httprequest.html
Good simple example of how it works.
http://www.dichotomize.com/czmap/gbold.html
Popular Examples:
http://flickr.com
http://gmail.com
http://local.google.com