AJAX and Rich Internet Applications

Description

• Asynchronous Javascript and XML
– Term coined by Jesse James Garrett
– www.adaptivepath.com
• AJAX is not a new technology
– Google calls their technique: Javascript
– Also known as XMLHTTP technique
– In use since at least 1997
• A bundle of techniques
– XML data interchange only
– Passing Javascript methods to client
– DHTML widgets
– XML & XSLTs

Reviews
Shared by: Vinothkumar
Stats
views:
39
rating:
not rated
reviews:
0
posted:
9/20/2009
language:
English
pages:
0
AJAX & Rich Internet Applications Bringing Interactivity & Intuitiveness Into Web Applications AJAX Defined • Asynchronous Javascript and XML – Term coined by Jesse James Garrett – www.adaptivepath.com • AJAX is not a new technology – Google calls their technique: Javascript – Also known as XMLHTTP technique – In use since at least 1997 Mr. Ajax • A bundle of techniques – – – – XML data interchange only Passing Javascript methods to client DHTML widgets XML & XSLTs • Core techniques are centered around asynchronous communication to the server without a page refresh So why is AJAX so hot—NOW? • Demand for richer applications is growing – Broadband means we can—and want to—do more • It has a name – Think LAMP—helped solidify the thoughts/techniques in people’s minds • Recent Google applications have sparked people’s imagination – Google gmail, Google suggests, Google Maps • People are thinking of building APPLICATIONS…not just sites • The Tipping Point – All of this has made rich internet apps reach its tipping point— where adoption spreads rapidly and dramatically AJAX Enabled Master Detail Form No full page refresh. Individual regions or fields updated. Client sends data to server asynchronously. Server returns data, messages, gui, or code. Traditional Web Applications… Pick An Item ‘Add To Cart’ Action Validation Persistence Forwarding Review Cart Enter Data Submit Action Validation Persistence Forwarding Enter Shipping Enter Data Submit Pages & Actions ‘Can’t Order 500’ Error Page Action Validation Persistence Forwarding Client code concerned with validation Submits sent to actions Actions perform work and then forward to next page Page refresh for each submit Unit of work is a page Enter Billing Enter Data Submit AJAX Changes How Web Apps are Built Components & Events Order Entry Item List (DIV) ErrorViewer (DIV) Events/Actions Validation Item List Component Shopping Cart Component Shipping Component Billing Component AJAX Shopping Cart (DIV) Shipping Form (DIV) Billing Form (DIV) Persistence Event Handlers GUI Creation Unit of work is a component Three-Tier Client/Server Model Client code has validation, flow, layout, data interchange No submit buttons—save buttons Only parts of pages are updated at a time Two ways of talking to the server… • XMLHTTPRequest object – – – – – Allows for asynchronous GETs + POSTs to the server Does not show the user anything—no status messages Can have multiple XMLHTTPRequest active at one time Allows you to specify a handler method for state changes Handler notified when request is: • Initialized • Started • In the process of being returned • Completely finished – Originally only available for Microsoft IE • IFRAME – – – – – – – IFRAME is a “mini-browser” window in an HTML document Can be hidden (0 width, 0 height) IFRAME can call a URL Javascript can read the contents of the IFRAME User sees messages on status bar Hears a click as server submits request Much slower than XMLHTTPRequest XMLHttpRequest Object: Methods • open(“method”, “URL”) • open(“method”, “URL”, async, username, password) – Assigns destination URL, method, etc. • send(content) – Sends request including postable string or DOM object data • abort() – Terminates current request • getAllResponseHeaders() – Returns headers (labels + values) as a string • getResponseHeader(“header”) – Returns value of a given header • setRequestHeader(“label”,”value”) – Sets Request Headers before sending XMLHttpRequest Properties • onreadystatechange – Event handler that fires at each state change – You implement your own function that handles this – – – – 0 = uninitialized 1 = loading 2 = loaded 3 = interactive (some data has been returned) • This is broken in IE right now – 4 = complete – HTTP Status returned from server: 200 = OK – String version of data returned from server – XML DOM document of data returned – Status text returned from server • readyState – current status of request • status • responseText • responseXML • statusText Message Flow
Shared by: Vinothkumar
Other docs by Vinothkumar
Sears Black Friday 2009 Deals
Views: 83  |  Downloads: 5
How to be noticed
Views: 36  |  Downloads: 0
How to be a good manager
Views: 52  |  Downloads: 1
How to Be an Effective Project Manager
Views: 19  |  Downloads: 0
How to Resolve a Conflict at Work
Views: 34  |  Downloads: 1
How to Be a Leader
Views: 12  |  Downloads: 1
How to Write a Resignation Letter
Views: 106  |  Downloads: 0
How to Respond to a Job Performance Review
Views: 74  |  Downloads: 0
How to Fire an Employee
Views: 105  |  Downloads: 3
How to Ask for a Pay Raise
Views: 22  |  Downloads: 0
How to Make a Resume
Views: 17  |  Downloads: 0
How to Get a Promotion
Views: 439  |  Downloads: 0
How to Train Someone to Do Your Job
Views: 15  |  Downloads: 0
How to Switch Careers
Views: 10  |  Downloads: 0
Related docs
AJAX
Views: 67  |  Downloads: 7
AJAX Introduction
Views: 264  |  Downloads: 85
Creating Rich Client Web Applications with AJAX
Views: 23  |  Downloads: 10
PHP AND AJAX
Views: 423  |  Downloads: 118
Ajax Book
Views: 396  |  Downloads: 50
Ajax Tutorial
Views: 295  |  Downloads: 87
Introduction to Ajax
Views: 112  |  Downloads: 37
Ajax In Action _2006_
Views: 93  |  Downloads: 19
Using AJAX in Domino Web Applications
Views: 359  |  Downloads: 16
AJAX A New Approach to Web Applications
Views: 56  |  Downloads: 16
Ajax Basics
Views: 27  |  Downloads: 0