AJAX based web applications
Donovan Ryan (959998)
Chihwei Hung (122250)
Outline
What is AJAX AJAX Technologies
Demonstration
Conclusion
What is AJAX
Asynchronous JAvaScript and XML Rich User Interface
Not a technology - collection of development techniques
Why use AJAX?
No Refresh Instant field checking and saving
Single Screen Interface
AJAX Technologies
Built on current web technologies JavaScript
XMLHttpRequest
XML (optional)
Disadvantages
Reliance on JavaScript Browser
Bookmarks/Web Browser History Issues Back/Forward button behaviour
How to code an AJAX application
1 – Create XMLHttpRequest
◦ http = new ActiveXObject("Microsoft.XMLHTTP");
Or
◦ http = new XMLHttpRequest();
How to code an AJAX application
2 – Event Handler Uses various methods of XMLHttpRequest
http.open("GET", ”canberra.edu.au/Assign2.AS P?id=1234”, true); http.onreadystatechange = useHttpResponse; http.send(null);
How to code an AJAX application
3 – Function to establish when the server has completed a request function useHttpResponse() { if (http.readyState == 4) { var textout = http.responseText; document.write.textout; } }
Demonstration
Google Suggest
◦ http://www.google.com/
Google Maps
◦ http://www.google.com/maps
Sample Site
◦ http://ajaxsearch.blogspot.com/
IBM & Microsoft AJAX support sites
ASP.NET AJAX
◦ http://www.asp.net/ajax/
Java
◦ http://www.eclipse.org/atf/
Conclusion
Future for AJAX web applications