Network Computing Laboratory Ajax - Rich User Experience Initiative - Dec. 7. 2005 Inseok Hwang.

Slides:



Advertisements
Similar presentations
AJAX Compiled from “AJAX Programming” [Sang Shin]
Advertisements

AJAX Presented by: Dickson Fu Dimas Ariawan Niels Andreassen Ryan Dial Jordan Nielson CMPUT 410 University of Alberta 2006.
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.
ITM352 Javascript and Dynamic Web Pages: Client Side Processing.
Prof. James A. Landay University of Washington Spring 2008 Web Interface Design, Prototyping, and Implementation Rich Internet Applications: AJAX, Server.
Christopher Paolini Computational Science Research Center College of Engineering San Diego State University Computational Science 670 Fall 2009 Monday.
Interactive Web Application with AJAX
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.
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.
HTML Forms and Scripts. Session overview What are forms? Static vs dynamic Client-side scripts –JavaScript.
1 Fall 2006 Florida Atlantic University Department of Computer Science & Engineering COT 6930 Advanced Internet Programming Dr. Roy Levow Day 1.
11/13/2007 A synchronous J avaScript A nd X ML Gloria Law Joshua Mahaz.
Lecture 12 – AJAX SFDV3011 – Advanced Web Development Reference: 1.
AJAX By Steven Hernandez Research Analyst NIATEC.
AJAX Without the “J” George Lawniczak. What is 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:
1 rfXcel Confidential Copyright 2007 Web Technology JavaScript 12/10/07.
AJAX Making Dynamic Web pages more Dynamic Jim Hendricks April 25th, 2006.
06/10/2015AJAX 1. 2 Introduction All material from AJAX – what is it? Traditional web pages and operation Examples of AJAX use Creating.
The Document Object Model. The Web B.D, A.D. They aren’t web pages, they’re document objects A web browser interprets structured information. A server.
Ajax. –Asynchronous JavaScript and XML –Umbrella term for technologies that often: Use client-side scripting for layout and formatting Use less than full.
HTML. Principle of Programming  Interface with PC 2 English Japanese Chinese Machine Code Compiler / Interpreter C++ Perl Assembler Machine Code.
Weekend MS CS Program Internet and Web Technologies COT 5930 Web Project Development - Ajax Dr. Roy Levow, Associate Chair & Professor
WEB SCIENCE. What is the difference between the Internet and the World Wide Web? Internet is the entire network of connected computers and routers used.
Random Logic l Forum.NET l AJAX Behind the buzz word Forum.NET ● January 23, 2006.
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.
Overview Web Session 3 Matakuliah: Web Database Tahun: 2008.
Session: 1. © Aptech Ltd. 2Introduction to the Web / Session 1  Explain the evolution of HTML  Explain the page structure used by HTML  List the drawbacks.
AJAX Compiled from “AJAX Programming” [Sang Shin] (Asynchronous JavaScript and XML)
Fall 2006 Florida Atlantic University Department of Computer Science & Engineering COP 4814 – Web Services Dr. Roy Levow Part 2 – Ajax Fundamentals.
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.
CISC 3140 (CIS 20.2) Design & Implementation of Software Application II Instructor : M. Meyer Address: Course Page:
INNOV-7: Building a Richer UI for the Browser Chris Skeldon Senior Solution Consultant.
INT222 - Internet Fundamentals Shi, Yue (Sunny) Office: T2095 SENECA COLLEGE.
 AJAX – Asynchronous JavaScript and XML  Ajax is used to develop fast dynamic web applications  Allows web pages to be updated asynchronously by transferring.
Web Technologies Lecture 7 Synchronous vs. asynchronous.
AJAX Asynchronous JavaScript and XML 1. AJAX Outline What is AJAX? Benefits Real world examples How it works 2.
 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.
JavaScript & Introduction to AJAX
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.
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..
A New Way To Web Applications Development Tin Htut Htut Naing Oo Myanmar Information Technology.
NCCUCS 軟體工程概論 Lecture 5: Ajax, Mashups April 29, 2014.
Ajax 101 for CF Programmers Randy Brown – Michigan State University
Working with Client-Side Scripting
AJAX and REST.
XMLHttp Object.
+ A Look at CFAjax Stephen Rittler CounterMarch Systems
AJAX – Asynchronous JavaScript and XML
Asynchronous Java script And XML Technology
AJAX.
Introduction to AJAX MIS 3502 Jeremy Shafer Department of MIS
Introduction to AJAX MIS 3502 Jeremy Shafer Department of MIS
AJAX Robin Burke ECT 360.
Giuseppe Attardi Università di Pisa
JavaScript & jQuery AJAX.
Intro to Ajax Fred Stluka Jan 25, 2006.
Client-Server Model: Requesting a Web Page
AJAX By Prof. B.A.Khivsara
Presentation transcript:

Network Computing Laboratory Ajax - Rich User Experience Initiative - Dec Inseok Hwang

Network Computing Laboratory | 2 Korea Advanced Institute of Science and Technology Outline Web as Application Limitation of Conventional HTML & HTTP Rich User Experience Initiatives “Interaction” and I/O models Ajax = Asynchronous Javascript & XML Javascript CSS DOM XMLHttpRequest References Case Study

Network Computing Laboratory | 3 Korea Advanced Institute of Science and Technology Web as Application The Web was to read and write.

Network Computing Laboratory | 4 Korea Advanced Institute of Science and Technology Web as Application The Web is turning into a place to do something

Network Computing Laboratory | 5 Korea Advanced Institute of Science and Technology Web as Application It is becoming more and more application. Transient application vs. Sovereign application (by Alan Cooper) Transient: might be used everyday, but in short bursts and mostly for secondary activities Dictionary, er, instant messenger, etc. Sovereign: Gets user’s full attention for a long time Word processor, Eclipse, Photoshop, etc. Many of currently established web-hosted applications are transient. Shopping malls, Search engines, eBanking, etc. Solutions based on web-pages are not enough for sovereign uses.

Network Computing Laboratory | 6 Korea Advanced Institute of Science and Technology Limitation of Conventional HTML & HTTP HTML is basically for presenting documents. HTTP is basically for requesting & delivering documents. The “Units” of documents are “pages”. (so is HTTP) Documents are static. HTML is declarative. HTTP is synchronous.

Network Computing Laboratory | 7 Korea Advanced Institute of Science and Technology Rich User Experience Initiatives ActiveX Macromedia Flash Java Applets More upcoming.. Ajax: OpenLaszlo: Macromedia Flex

Network Computing Laboratory | 8 Korea Advanced Institute of Science and Technology Interaction and I/O models Interaction in Real Worlds Action  Reaction “A successful computer UI needs to mimic our expectations of the real world at the very basic level.” We expect “immediate response” when we push, pull, touch, etc. Slight delays can be annoying, distracting user’s attention.

Network Computing Laboratory | 9 Korea Advanced Institute of Science and Technology Interaction and I/O models A typical remote procedure call (HTTP, too) Calling function Local ModelSerializationApp. protocolPhy. transportApp. protocolSerialization Local Model

Network Computing Laboratory | 10 Korea Advanced Institute of Science and Technology Interaction and I/O models Blocking I/O Non-blocking I/O

Network Computing Laboratory | 11 Korea Advanced Institute of Science and Technology Interaction and I/O models Multiplexed I/O Signal-driven I/O

Network Computing Laboratory | 12 Korea Advanced Institute of Science and Technology Interaction and I/O models Asynchronous I/O

Network Computing Laboratory | 13 Korea Advanced Institute of Science and Technology Ajax: Asynchronous Javascript and XML Ajax is not a new technology, but a synergy of existing technology. Ajax = Asynchronous I/O between server and client (XMLHttpRequest) Client-side dynamicity by DHTML (Javascript, CSS, DOM) XML-formatted data delivery Two Self-developed Ajax Examples

Network Computing Laboratory | 14 Korea Advanced Institute of Science and Technology Ajax: Asynchronous Javascript and XML Four defining principles of Ajax 1. The browser hosts an Application, not Content. Web Browser Web Page Web Page Web Page Exit Page Server User Session Shared Data Model Business Logic User’s Data Model

Network Computing Laboratory | 15 Korea Advanced Institute of Science and Technology Ajax: Asynchronous Javascript and XML Four defining principles of Ajax 1. The browser hosts an Application, not Content. (cont’d) Web Browser Exit Page Server User Session Shared Data Model Business Logic User’s Data Model Client App. User’s Partial Data Model Deliver Application

Network Computing Laboratory | 16 Korea Advanced Institute of Science and Technology Ajax: Asynchronous Javascript and XML Four defining principles of Ajax (cont’d) 2. The server delivers data, not content Time Data New Page Time Data New Page Content Branding Data Logic Presentation Data

Network Computing Laboratory | 17 Korea Advanced Institute of Science and Technology Ajax: Asynchronous Javascript and XML Four defining principles of Ajax (cont’d) 3. User interaction with the application can be fluid and continuous 4. This is real coding and requires discipline

Network Computing Laboratory | 18 Korea Advanced Institute of Science and Technology Ajax: Asynchronous Javascript and XML CSS (Cascading Style Sheet) style.css … index.html … Defines Look & Feel Defines Structure

Network Computing Laboratory | 19 Korea Advanced Institute of Science and Technology Ajax: Asynchronous Javascript and XML CSS (Cascading Style Sheet) Advantages Cleaner, Compacter HTML High Reusability of HTML codes More Program-friendly Easy maintenance and upgrades Higher readability, intuitive HTML Examples Classic Example (mixed HTML & styles, table as layout, etc.) Separated CSS & HTML Example My own blog

Network Computing Laboratory | 20 Korea Advanced Institute of Science and Technology Ajax: Asynchronous Javascript and XML DOM (Document Object Model) A structural representation of a document document html head title meta body div text div …

Network Computing Laboratory | 21 Korea Advanced Institute of Science and Technology Ajax: Asynchronous Javascript and XML DOM (Document Object Model)

Network Computing Laboratory | 22 Korea Advanced Institute of Science and Technology Ajax: Asynchronous Javascript and XML DOM (Document Object Model) DOM manipulation by Javascript document.getElementById(“id”) document.getElementByTagName(“tag”) something.childNodes something.parentNode document.createElement(“...”) document.createTextNode(“…”) something.appendChild() something.className something.style (Dark Side ^-_-^) something.innerHTML Example:

Network Computing Laboratory | 23 Korea Advanced Institute of Science and Technology Ajax: Asynchronous Javascript and XML XMLHttpRequest Enabler of asynchronous request & response An API member of XMLHTTP object History Originally designed by M$ as an ActiveX object since IE 5.0, enabled with Javascript, Vbscript, etc. Others followed: Mozilla 1.0, Safari 1.2, Opera 8.0 General step: 1. Create an XMLHttpRequest object 2. Register a callback handler 3. Make a asynchronous request to server 4. When completed, the callback handler is invoked.

Network Computing Laboratory | 24 Korea Advanced Institute of Science and Technology Ajax: Asynchronous Javascript and XML XMLHttpRequest Example Code: Fun with Google Map API More Formally, function getXMLHTTPRequest(){ var xRequest = null; if (window.XMLHttpRequest){ xRequest = new XMLHttpRequest();// Mozilla, Safari }else if (typeof ActiveXObject != “undefined”){ xRequest = new ActiveXObject(“Microsoft.XMLHTTP”);// IE } return xRequest; }

Network Computing Laboratory | 25 Korea Advanced Institute of Science and Technology Ajax: Asynchronous Javascript and XML XMLHttpRequest More Formally, var READY_STATE_UNINITIALIZED=0; var READY_STATE_LOADING=1; var READY_STATE_LOADED=2; var READY_STATE_INTERACTIVE=3; var READY_STATE_COMPLETE=4; var req; function sendRequest(url, params, HttpMethod){ if (!HttpRequest){ HttpRequest=“Get”; } req = getXMLHTTPRequest(); if (req){ req.onreadystatechange = onReadyStateChange; req.oepn(HttpMethod, url, true); req.setRequestHeader(“Content-Type”, “application/x-www-form-urlencoded”); req.send(params); }

Network Computing Laboratory | 26 Korea Advanced Institute of Science and Technology Ajax: Asynchronous Javascript and XML XMLHttpRequest More Formally, In NIFA example, we do presentation of the received information by visualizing hidden layer. function onReadyStateChange(){ var ready=req.readyState; var data=null; if (ready==READY_STATE_COMPLETE){ data=req.responseText; }else{ data=“loading…[“ + ready + “]”; } // do something with the data }

Network Computing Laboratory | 27 Korea Advanced Institute of Science and Technology Ajax: Asynchronous Javascript and XML XMLHttpRequest Server-side program Little difference from conventional server program Example NIFA

Network Computing Laboratory | 28 Korea Advanced Institute of Science and Technology Ajax: Asynchronous Javascript and XML XMLHttpRequest Is this something special?? It’s nothing more than HTTP itself!!!

Network Computing Laboratory | 29 Korea Advanced Institute of Science and Technology Ajax: Asynchronous Javascript and XML XMLHttpRequest Common Mistakes XMLHttpRequest is “Asynchronous”. XMLHttpRequest receives “XML”-formatted response.

Network Computing Laboratory | 30 Korea Advanced Institute of Science and Technology Bonus RSS (Really Simple Syndication) “Push” has been a dream in web technology community for a long time. However, HTTP is basically “Pull” technology. RSS is a trick to implement push technology as conventional HTTP. Marine Blues

Network Computing Laboratory | 31 Korea Advanced Institute of Science and Technology References “Ajax in Action”