AJAX - Fekke.com

Download Report

Transcript AJAX - Fekke.com

AJAX
JaxFusion April 2006
David Fekke
Who am I?
David Fekke
 Lead Software Engineer
Data Inteligence Group
 http://www.fekke.com/blog/
 [email protected]

Ajax?

What is Ajax?
Just kidding!
Asynchronous JavaScript and XML
 Makes use XMLHttpRequest object in
concert with the dynamic html and
XML

Whats all the hype about
Fully buzzword compliant
 Web 2.0
 Build truly dynamic web applications

Some examples
Google Maps
 Gmail
 Local.live.com

History
Nothing new here
 Remote scripting 1998
 Major differences between IE4 and
Netscape 4, IFRAME vs LAYER
 Term coined by Adaptive Path

XMLHttp Request Object
Syntax different depending on browser
 Mozilla, Safari, Opera
new XMLHttpRequest()
 Internet Explorer
new ActiveXObject("Microsoft.XMLHTTP")

XMLHttp methods and properties
XMLHTTPObj.open(“get”,url,true);
 .setRequestHeader(“name”,”value”);
 .send();
 .responseText;
 .responseXML;

XML methods & properties
getElementsByTagName()[];
 childNode[1].nodeValue;
 firstChild.nodeValue;
 UDF getElementTextNS()

DHTML methods & properties
getElementById();
 innerHTML;
 createElement();
 appendChild();
 createTextNode();

Transport methods
SOAP
 REST

ColdFusion Ajax frameworks
Cfajax
 AjaxCFC
 JSMX
 IBM WSAjax

Pros
Pull back small pieces of data without
having to reload the whole page.
 Can save bandwidth
 More Interactive

Cons
Back button does not work as
expected
 Security issues
 Network latency
 Compatibility, older browsers,
JavaScript inactivated
 Accessibility

Compatible Browsers
IE5+
 Gecko based browsers, Mozilla,
Firefox, Netscape 7.1+ . . .
 KHTML, Konqueror, Safari 1.2+
 Opera 8+

Non compatible browsers
Opera 7 and lower
 Lynx, text based
 Visually impaired browsers

Resources
http://adaptivepath.com
 http://www.indiankey.com/cfajax/
 http://developer.apple.com/internet/we
bcontent/xmlhttpreq.html
 http://www128.ibm.com/developerworks/webserv
ices/library/ws-wsajax/
