Intro to Ajax Fred Stluka Jan 25, 2006.

Slides:



Advertisements
Similar presentations
3rd Annual Plex/2E Worldwide Users Conference Page based on Title Slide from Slide Layout palette. Design is cacorp Title text for Title or Divider.
Advertisements

9. AJAX & RIA. 2 Motto: O! call back yesterday, bid time return. — William Shakespeare.
AJAX Presented by: Dickson Fu Dimas Ariawan Niels Andreassen Ryan Dial Jordan Nielson CMPUT 410 University of Alberta 2006.
Asynchronous HTTP request generation in JavaScript (AJAX)
1 JavaScript & AJAX CS , Spring JavaScript.
Chapter 6 DOJO TOOLKITS. Objectives Discuss XML DOM Discuss JSON Discuss Ajax Response in XML, HTML, JSON, and Other Data Type.
The Document Object Model (DOM) & Asynchronous Javascript And XML (AJAX) : an introduction UFCEKG-20-2 : Data, Schemas and Applications.
Introduction to AJAX AJAX Keywords: JavaScript and XML
Ajax (Asynchronous JavaScript and XML). AJAX  Enable asynchronous communication between a web client and a server.  A client is not blocked when an.
CGI and AJAX CS-260 Dick Steflik.
Ajax Basics The XMLHttpRequest Object. Ajax is…. Ajax is not…. Ajax is not a programming language. Ajax is not a programming language. Ajax is a methodology.
1 Ajax. 2 What’s Ajax? AJAX is a combination of a few technologies that has come together in the past few years AJAX used to be an acronym for Asynchronous.
CSCI 6962: Server-side Design and Programming Introduction to AJAX.
Lecture 12 – AJAX SFDV3011 – Advanced Web Development Reference: 1.
AJAX Without the “J” George Lawniczak. What is Ajax?
JavaScript, Fourth Edition Chapter 12 Updating Web Pages with AJAX.
AJAX and Java ISYS 350. AJAX Asynchronous JavaScript and XML: – Related technologies: JavaScript, Document Object Model, XML, server-side script such.
Intro to Ajax Fred Stluka Jan 25, /25/2006Intro to AjaxFred Stluka2 What is Ajax? "Asynchronous JavaScript and XML" New name for an old technique:
06/10/2015AJAX 1. 2 Introduction All material from AJAX – what is it? Traditional web pages and operation Examples of AJAX use Creating.
Instructor, Dr. Khalili Bahram Jeevan Kumar Gogineni.
Random Logic l Forum.NET l AJAX Behind the buzz word Forum.NET ● January 23, 2006.
Ajax In Action The Journey into Web2.0 Presented by Eric Pascarello.
Building Rich Web Applications with Ajax Linda Dailey Paulson IEEE – Computer, October 05 (Vol.38, No.10) Presented by Jingming Zhang.
AJAX (also known as: XMLHTTP, Remote Scripting, XMLHttpRequest, etc.) Matt Warden.
Lecture 9: AJAX, Javascript review..  AJAX  Synchronous vs. asynchronous browsing.  Refreshing only “part of a page” from a URL.  Frameworks: Prototype,
AJAX Compiled from “AJAX Programming” [Sang Shin] (Asynchronous JavaScript and XML)
Asynchronous Javascript And XML AJAX : an introduction UFCEUS-20-2 : Web Programming.
Ajax ( Asynchronous JavaScript + XML ) Information Science and Knowledge Systems: Semantic Web Spring 2006 / Dr. Don Turnbull Presented by David Kim.
CISC 3140 (CIS 20.2) Design & Implementation of Software Application II Instructor : M. Meyer Address: Course Page:
INT222 - Internet Fundamentals Shi, Yue (Sunny) Office: T2095 SENECA COLLEGE.
Event Handling & AJAX IT210 Web Systems. Question How do we enable users to dynamically interact with a website? Answer: Use mouse and keyboard to trigger.
AJAX and REST. Slide 2 What is AJAX? It’s an acronym for Asynchronous JavaScript and XML Although requests need not be asynchronous It’s not really a.
Dave Salinas. What is XML? XML stands for eXtensible Markup Language Markup language, like HTML HTML was designed to display data, whereas XML was designed.
AJAX AJAX Asynchronous JavaScript and XML --- MADHAVI
AJAX – Asynchronous JavaScript And XML By Kranthi Kiran Nuthi CIS 764 Kansas State University.
INNOV-2: Build a Better Web Interface Using AJAX Chris Morgan Pandora Software Systems
Web Technology (NCS-504) Prepared By Mr. Abhishek Kesharwani Assistant Professor,UCER Naini,Allahabad.
 AJAX technology  Rich User Experience  Characteristics  Real live examples  JavaScript and AJAX  Web application workflow model – synchronous vs.
AJAX CS456 Fall Examples Where is AJAX used? Why do we care?
1 AJAX. AJAX – Whatzit? Asynchronous (content loading)‏ Javascript (logic & control)‏ And XML (request handling)‏
JavaScript, Sixth Edition Chapter 11 Updating Web Pages with Ajax.
A New Way To Web Applications Development Tin Htut Htut Naing Oo Myanmar Information Technology.
JavaScript and Ajax Week 10 Web site:
CITA 330 Section 10 Web Remoting Techniques. Web Remoting Web Remoting is a term used to categorize the technique of using JavaScript to directly make.
NCCUCS 軟體工程概論 Lecture 5: Ajax, Mashups April 29, 2014.
Ajax 101 for CF Programmers Randy Brown – Michigan State University
AJAX. Objectives Understand and apply AJAX Using AJAX in DOJO library.
CS520 Web Programming Introduction to Ajax and jQuery Chengyu Sun California State University, Los Angeles.
AJAX Rohan B Thimmappa. What Is AJAX? AJAX stands for Asynchronous JavaScript and XML. AJAX stands for Asynchronous JavaScript and XML. A remote scripting.
Introduction to AJAX Pat Morin COMP Outline What is AJAX? – History – Uses – Pros and Cons An XML HTTP Transaction – Creating an XMLHTTPRequest.
JavaScript and Ajax (Ajax Tutorial)
CSE 154 Lecture 11: AJAx.
Not a Language but a series of techniques
AJAX AJAX = Asynchronous JavaScript and XML.
AJAX and REST.
XMLHttp Object.
AJAX – Asynchronous JavaScript and XML
AJAX.
AJAX.
CSE 154 Lecture 11: AJAx.
Giuseppe Attardi Università di Pisa
CSE 154 Lecture 22: AJAX.
AJAX Robin Burke ECT 360.
Giuseppe Attardi Università di Pisa
JavaScript & AJAX.
JavaScript & jQuery AJAX.
Chengyu Sun California State University, Los Angeles
AJAX CS-422 Dick Steflik.
Chengyu Sun California State University, Los Angeles
Chengyu Sun California State University, Los Angeles
Presentation transcript:

Intro to Ajax Fred Stluka Jan 25, 2006

Intro to Ajax Fred Stluka 1/25/2006 What is Ajax? "Asynchronous JavaScript and XML" New name for an old technique: JavaScript + DHTML + XMLHttpRequest In use since at least 1997 I've used it since 2000 Finally someone gave it a name Already enabled in your Web server and browser Use JavaScript asynchronously behind the scenes to load additional data (typically XML) without discarding and reloading the entire Web page. 1/25/2006 Intro to Ajax Fred Stluka

Intro to Ajax Fred Stluka Why use Ajax? Your users will soon demand it Not just another cool (geeky) technology Very user-visible effect Rich UI experience in a Web page Portable across browsers Plus, all advantages of zero-install Web app No install done for this demo No "DLL Hell" 1/25/2006 Intro to Ajax Fred Stluka

Intro to Ajax Fred Stluka Why use Ajax? Client/Server Apps: Dynamic data Static forms, controls, code, etc. Efficient, but not flexible Traditional Web Apps: Dynamic forms, controls, code, etc. Flexible, but inefficient, and noticeably slow Ajax Apps: Static or dynamic forms, controls, code, etc. Best of both worlds 1/25/2006 Intro to Ajax Fred Stluka

Intro to Ajax Fred Stluka Why use Ajax? Geeky reasons: Multithreaded data retrieval from Web servers Pre-fetch data before needed Progress indicators Appearance of speed Avoids need for setTimeout() Less bandwidth required; less server load Reload partial page, not entire page Load data only, not even partial page 1/25/2006 Intro to Ajax Fred Stluka

Intro to Ajax Fred Stluka How much to use Ajax? As little or as much as you like No need to abandon what you already do One more item in your "bag of tricks" Start by jazzing up your existing UI 1/25/2006 Intro to Ajax Fred Stluka

Intro to Ajax Fred Stluka 1/25/2006 How to use Ajax? Simple! Use the XMLHttpRequest Object 1/25/2006 Intro to Ajax Fred Stluka

XMLHttpRequest Methods 1/25/2006 XMLHttpRequest Methods open (“method”, “URL”, [async, username, password]) Assigns destination URL, method, etc. send (params) Sends request including postable string or DOM object data abort () Terminates current request getAllResponseHeaders () Returns headers (name/value pairs) as a string getResponseHeader (“header”) Returns value of a given header setRequestHeader (“label”,”value”) Sets Request Headers before sending 1/25/2006 Intro to Ajax Fred Stluka

XMLHttpRequest Properties 1/25/2006 XMLHttpRequest Properties onreadystatechange Event handler (your code) that fires at each state change readyState 0 = uninitialized 3 = interactive (some data has been returned) 1 = loading (broken in IE 6.0) 2 = loaded 4 = complete status HTTP Status returned from server: 200-299 = OK responseText String version of data returned from server responseXML XML DOM document of data returned statusText Status text returned from server 1/25/2006 Intro to Ajax Fred Stluka

Intro to Ajax Fred Stluka 1/25/2006 Simple Example var req = new XMLHttpRequest(); req.onreadystatechange = myHandler; req.open("GET", "servlet", true); req.send("p1=abc"); ... function myHandler() { if (req.readyState == 4) { doSomethingWith(req.responseXML); } else if (req.readyState == 3) { showProgressIndicator(); 1/25/2006 Intro to Ajax Fred Stluka

Intro to Ajax Fred Stluka Demos http://bristle.com/~fred/#ajax Simple demo More demos Google Suggest Google Maps Language translation Mouse gesture as password Typing speed as password Classified ads tied to map "Mashups" 1/25/2006 Intro to Ajax Fred Stluka

Intro to Ajax Fred Stluka Security Issues Can only hit domain the Web page came from Cannot access a 3rd party Web Service However: You can wrap those requests through your own server User can allow access to specific sites via browser security settings IFRAME can access any site (instead of XMLHttpRequest) 1/25/2006 Intro to Ajax Fred Stluka

Intro to Ajax Fred Stluka Advanced Topics http://bristle.com/~fred/#ajax XSLT and XPath support (Sarissa) Serializing Java Beans as XML XMLBeans, JAXB, Zeus, Jbind, Castor, Betwixt Serializing Java Beans as JavaScript objects JSON -- JavaScript Object Notation 2-way Mapping of Java Beans to JavaScript objects DWR -- Direct Web Remoting Ajax Component Libraries and Toolkits: Dojo, Prototype, HTC, XBL Implemented as JSP tag libraries or pure JavaScript Ajax Frameworks Ajax Patterns 1/25/2006 Intro to Ajax Fred Stluka