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.
- Technologies worth knowing
- How it works
- Asynchronous request.
- Same old HTTP (Get, Post, etc)
HTTP transport mechanism without reloading the page.
NOT strictly XML; any data 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) }
}
Use JavaScript 'eval' function to absorb JSON at retrieval time.
Sessions and cookies work as you would normally expect on a normal webpage.
Faster, lighter interactions. Less weary on users. Do more with less.
Faster implementation??
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. URL: [[http://www.nearwhere.com/guest/]]
- Mashup of ski resorts and hotels. URL: [[http://skiwhere.com/map/]]
- Excellent XMLHTTPRequest introduction: [[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]]