AJAX Without the “J” George Lawniczak. What is Ajax?

Slides:



Advertisements
Similar presentations
Ajax. Overview of Ajax History In the 1990s, most web sites were based on complete HTML pages; each user action required that the page be re-loaded from.
Advertisements

Dodick Zulaimi Sudirman Lecture 12 Introduction to AJAX Pengantar Teknologi Internet Introduction to Internet Technology.
University of Virginia 1 Modern Web Application Development Overview of some newer web applications methods Web 2.0 Ajax fundamentals Ruby on Rails.
9. AJAX & RIA. 2 Motto: O! call back yesterday, bid time return. — William Shakespeare.
6/3/2015eBiquity1 Tutorial on AJAX Anubhav Kale (akale1 AT cs DOT umbc DOT edu)
AJAX Presented by: Dickson Fu Dimas Ariawan Niels Andreassen Ryan Dial Jordan Nielson CMPUT 410 University of Alberta 2006.
Cloud Computing Lecture #7 Introduction to Ajax Jimmy Lin The iSchool University of Maryland Wednesday, October 15, 2008 This work is licensed under a.
Dynamic Web Pages Bert Wachsmuth. Review  Internet, IP addresses, ports, client-server, http, smtp  HTML, XHTML, XML  Style Sheets, external, internal,
Does Ajax suck? CS575 Spring 2007 Chanwit Suebsureekul.
1 JavaScript & AJAX CS , Spring JavaScript.
A closer look Dynamic Webpages Jessica Meyerson March 1, 2011.
Web Services & Widgets Godmar Back. Mash-Ups Applications that combine information from different sources in one web page Different architectural choices.
Ryan Putz. Outline  What is Ajax?  Member Technologies  Methodology  When and When Not To Use  Who’s Using Ajax?  Code Examples.
Pittsburgh Java User Group– Dec Java PureFaces: A JSF Framework Extension.
JavaScript & jQuery the missing manual Chapter 11
Ruth Betcher Ruth Christie
CSCI 6962: Server-side Design and Programming Introduction to AJAX.
Lecture 12 – AJAX SFDV3011 – Advanced Web Development Reference: 1.
AJAX in ASP.NET James Crowley Developer Fusion
 2008 Pearson Education, Inc. All rights reserved Ajax-Enabled Rich Internet Applications.
JavaScript, Fourth Edition Chapter 12 Updating Web Pages with AJAX.
JDeveloper 10g and JavaServer Faces: High-Performance UIs on the Web Avrom Roy-Faderman Senior Programmer May, 2006.
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:
AJAX Making Dynamic Web pages more Dynamic Jim Hendricks April 25th, 2006.
AJAX Copyright © 2006 Accenture. All rights reserved. Accenture, its logo, and Accenture High Performance Delivered are trademarks of Accenture. Yulin.
AJAX and Atlas in ASP.NET 2.0 William J. Steele MSDN Developer Evangelist Microsoft Corporation
Instructor, Dr. Khalili Bahram Jeevan Kumar Gogineni.
Ajax. –Asynchronous JavaScript and XML –Umbrella term for technologies that often: Use client-side scripting for layout and formatting Use less than full.
Weekend MS CS Program Internet and Web Technologies COT 5930 Web Project Development - Ajax Dr. Roy Levow, Associate Chair & Professor
Web Applications BIS4430 – unit 8. Learning Objectives Explain the uses of web application frameworks Relate the client-side, server-side architecture.
Random Logic l Forum.NET l AJAX Behind the buzz word Forum.NET ● January 23, 2006.
Ventsislav Popov Crossroad Ltd.. 1. What is AJAX?  AJAX Concept  ASP.NET AJAX Framework 2. ASP.NET AJAX Server Controls  ScriptManager, UpdatePanel.
1 Geospatial and Business Intelligence Jean-Sébastien Turcotte Executive VP San Francisco - April 2007 Streamlining web mapping applications.
Building Rich Web Applications with Ajax Linda Dailey Paulson IEEE – Computer, October 05 (Vol.38, No.10) Presented by Jingming Zhang.
Telerik Software Academy ASP.NET Web Forms Telerik Software Academy ASP.NET Web Forms.
AJAX Compiled from “AJAX Programming” [Sang Shin] (Asynchronous JavaScript and XML)
Ajax. –Asynchronous JavaScript and XML –Umbrella term for technologies that often: Use client-side scripting for layout and formatting Use less than full.
Asynchronous Javascript And XML AJAX : an introduction UFCEUS-20-2 : Web Programming.
Web Technology Introduction AJAXAJAX. AJAX Outline  What is AJAX?  Benefits  Real world examples  How it works  Code review  Samples.
INNOV-7: Building a Richer UI for the Browser Chris Skeldon Senior Solution Consultant.
RIA and Web2.0 Development with no Coding Juan Camilo Ruiz Senior Product Manager Development Tools.
Ajax for Dynamic Web Development Gregory McChesney.
Chapter 16: Ajax-Enabled Rich Internet Applications with XML and JSON TP2543 Web Programming Mohammad Faidzul Nasrudin.
Spring and DWR Frameworks for Rich Web Enterprise Application Thomas Wiradikusuma Presentation to the 20 th.
INT222 - Internet Fundamentals Shi, Yue (Sunny) Office: T2095 SENECA COLLEGE.
 Web pages originally static  Page is delivered exactly as stored on server  Same information displayed for all users, from all contexts  Dynamic.
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.
AJAX AJAX Asynchronous JavaScript and XML --- MADHAVI
Introduction to AJAX Sue Brandreth. What is Ajax?
AJAX – Asynchronous JavaScript And XML By Kranthi Kiran Nuthi CIS 764 Kansas State University.
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?
PHP and AJAX. Servers and Clients For many years we tried to move as much as possible to the server. Weak clients, poor bandwidth, browser compatibility..
Ajax 101 for CF Programmers Randy Brown – Michigan State University
Ajax & Client-side Dynamic Web Gunwoo Park (Undergraduate)
Introduction to AJAX Pat Morin COMP Outline What is AJAX? – History – Uses – Pros and Cons An XML HTTP Transaction – Creating an XMLHTTPRequest.
Working with Client-Side Scripting
AJAX and REST.
AJAX.
Giuseppe Attardi Università di Pisa
Giuseppe Attardi Università di Pisa
Introduction to AJAX Sue Brandreth.
MIS JavaScript and API Workshop (Part 3)
Chengyu Sun California State University, Los Angeles
Intro to Ajax Fred Stluka Jan 25, 2006.
Chengyu Sun California State University, Los Angeles
Ajax and JSON Jeremy Shafer Department of MIS Fox School of Business
Chengyu Sun California State University, Los Angeles
Ajax and JSON Jeremy Shafer Department of MIS Fox School of Business
Presentation transcript:

AJAX Without the “J” George Lawniczak

What is Ajax?

A synchronous J avaScript A nd X mlHttpRequest (XHR) –Some use XML, but to me that’s misleading

Why Ajax? XHR Support across all browsers –Based on DOM, CSS, XHTML Emergence of broadband –AJAX-based JavaScript can take considerable bandwidth to download The “Killer App” - Google Maps A Catchy Acronym –Coined by Jesse James Garrett of Adaptive Path (February 2005)

Why Ajax? Source: Garrett(2005)

Why Ajax? Source: Garrett(2005)

AJAX Alternatives Macromedia Flash –Requires a plug-in So what? It comes already with almost every browser Java Web Start/Applets.NET – No Touch Deployment –Both need a runtime preinstalled Handheld device browsers generally do not support the full range of Ajax technologies.

Implementing AJAX To implement AJAX we need to answer three questions: –What triggers the AJAX request? Usually a JavaScript event (onblur, onclick, etc.) –What is the server process that handles the AJAX request and issues the response? Some kind of URL (use a Service Locator) –What processes the response from the server(what is the callback method)? A JavaScript function that gets the response and manipulates the DOM, based on the text returned.

XmlHttpRequest Object (XHR) The Heart of AJAX First implemented in IE in 1997 as part of the new DHTML standard Response comes in one of two properties: –responseXML – Returns a DOM document (can use functions such as, getElementById() ) –responseText – A text string (can be HTML, or even JavaScript code)

XHR : Creating

XHR : Sending the Request true = asynchronous

XHR : Using a callback handler

Handling the Response Response can be one of the following: –Formatted data (XML, other custom format) XMLHttpRequest.responseXML Decouples the server from presentation issues Could perform XSLT transformation on returned XML –HTML XMLHttpRequest.responseText Server generates HTML, script “injects” HTML via innerHTML Server is now concerned with presentation –JavaScript XMLHttpRequest.responseText Use the eval() JavaScript command Again, our server code is concerned with presentation

AJAX Concerns Security Browser Compatibility Accessibility The Back Button What if JavaScript is Turned Off?

AJAX and the Back Button Huge usability issue Returning to the previous state may not be possible when a page is updated dynamically Difficult to bookmark on a particular page state Really Simple History (RSH) framework addresses these issues –

AJAX Security – Server of Origin Policy

AJAX Security Browsers impose security restrictions –Cannot make requests via the XHR outside of the domain the web page came from Can set security on IE to get around this (but you really don’t want to) Mozilla-based browsers require digitally signing your script (Yuck!) –User must approve going to site. Firefox requires additional code

AJAX Security Calling third-party web-services –Application Proxies – Call the web-service from a servlet –Apache Proxy – Configure Apache to invisibly reroute from the server to the target web service domain

Encapsulating our AJAX Logic

Encapsulating our AJAX Logic (cont.)

Problems with JavaScript Most Java developers know enough JavaScript to be dangerous. –If you don’t know what you are doing, you could cause memory leaks on the client machine. Most JavaScript functionality can be factored out and encapsulated

Ajax Without the J It would be nice to encapsulate all of the JavaScript within our components, so we don’t have to write any JavaScript. JavaServer Faces (JSF) provides a way to accomplish this.

JSF and AJAX Why JSF makes sense -JSF Lifecycle -Separates the things that don’t change (client-side) from the things that do change (server-side) -Echo2 is another Java component- based web framework that supports AJAX. -

Sun BluePrints Solutions Catalog Sun defines best practices for integrating AJAX into JSF applications.

Java Studio Creator 2 Sun has released several AJAX components that are available for Creator 2 - Auto-Complete Text Field - Progress Bar - Map Viewer - Select Value Text Field Obtain components via Creator’s “Update Center”

Demo – Creator 2 AJAX Components Auto Complete Map Viewer Drag-and-drop components –Code server-based functionality

Demo – DWR (Direct Web Remoting) Call methods from a POJO that reside on the server. Wraps objects in a JavaScript wrapper

Links Original AJAX Blog by Jesse James Garrett – “Fixing AJAX: XMLHttpRequest Considered Harmful” – DWR (Direct Web Remoting) Home Page – Java AJAX BluePrints Solutions Catalog – “ AJAX Without the J” Blog – Really Simple History (RSH) Framework – ECHO 2 Web Framework -

Questions My is: