Introduction to Ajax Professor Stephen K. Kwan MIS, College of Business San José State University Asynchronous.

Slides:



Advertisements
Similar presentations
Mash-it-up Google Style Put your data on the Map.
Advertisements

AJAX Asynchronous JavaScript and XML. AJAX An interface that allows for the HTTP communication without page refreshment Web pages are loaded into an object.
Davis Dai. Introduction  Acronym for “asynchronous JavaScript and XML”  Combination of various technologies  Was not developed as an official standard.
AJAX Presented by: Dickson Fu Dimas Ariawan Niels Andreassen Ryan Dial Jordan Nielson CMPUT 410 University of Alberta 2006.
CS 142 Lecture Notes: HTMLSlide 1 Introduction There are several good reasons for taking CS142: Web Applications: ● You will learn a variety of interesting.
19-Jun-15 Ajax. The hype Ajax (sometimes capitalized as AJAX) stands for Asynchronous JavaScript And XML Ajax is a technique for creating “better, faster,
AJAX asynchronous server-client communication. Test.
Web Applications A Client/Server Computing Model ClientComputerBrowserServerComputerHTTPService HTTP REQUEST HTTP RESPONSE (URL,Post,Get,parameters,..)
AJAX (Asynchronous JavaScript and XML) Amit Jain CS 590 – Winter 2008.
XMLHttpRequest Object and XML What we should learn in this lesson –What is the XHR object? –How to create the XHR objects? –XHR object properties –XHR.
Introduction to XHTML Professor Stephen Kwan. 2 XHTML HTML StyleSheets XML CascadingStyleSheets(CSS) ExtensibleStylesheetLanguage(XSL) StructureFormatContent.
Prof. James A. Landay University of Washington Spring 2008 Web Interface Design, Prototyping, and Implementation Rich Internet Applications: AJAX, Server.
Making AJAX Easy with jQuery Chris Renner Health Systems Analyst Programmer & Informatics Manager VUMC Office of Grants & Contracts Management October.
Writing All Your Code In OpenEdge Architect Peter van Dam.
AJAX Workshop Karen A. Coombs University of Houston Libraries Jason A. Clark Montana State University Libraries.
Internet Applications Spring Review Last week –MySQL –Questions?
Ajax (Asynchronous JavaScript and XML). AJAX  Enable asynchronous communication between a web client and a server.  A client is not blocked when an.
PHP and AJAX ISYS 475. AJAX Asynchronous JavaScript and XML: – JavaScript, Document Object Model, Cascade Style Sheet, XML, server-side script such as.Net,
Lecture 12 – AJAX SFDV3011 – Advanced Web Development Reference: 1.
AJAX By Steven Hernandez Research Analyst NIATEC.
AJAX and Java ISYS 350. AJAX Asynchronous JavaScript and XML: – Related technologies: JavaScript, Document Object Model, XML, server-side script such.
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.
Ajax. –Asynchronous JavaScript and XML –Umbrella term for technologies that often: Use client-side scripting for layout and formatting Use less than full.
Ajax - 1h. AJAX IS: A browser technology A technology that uses only JavaScript in the browser page A very efficient way of updating information A way.
Weekend MS CS Program Internet and Web Technologies COT 5930 Web Project Development - Ajax Dr. Roy Levow, Associate Chair & Professor
Google APIs Why Aren’t You Using Them? Jeff Blankenburg Project Engineer Quick Solutions, Inc.
AJAX (also known as: XMLHTTP, Remote Scripting, XMLHttpRequest, etc.) Matt Warden.
TerraFly Project High Performance Database Research CenterHigh Performance Database Research Center NASA Regional Applications CenterNASA Regional Applications.
Ajax XMod for Dummies Building DNN Ajax Modules Without Programming Dave McMullen SoCal DNN Users Group 2/7/07 –
School of Computing and Information Systems CS 371 Web Application Programming AJAX.
CISC 3140 (CIS 20.2) Design & Implementation of Software Application II Instructor : M. Meyer Address: Course Page:
AJAX Asynchronous JavaScript & XML A short introduction.
the acronym for Asynchronous JavaScript and XML.
SYST Web Technologies SYST Web Technologies AJAX.
Ajax for Dynamic Web Development Gregory McChesney.
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.
CIS 375—Web App Dev II JavaScript I. 2 Introduction to DTD JavaScript is a scripting language developed by ________. A scripting language is a lightweight.
SE-2840 Dr. Mark L. Hornick 1 Introduction to Ajax Asynchronous Javascript And XML.
Web Programming JAvaScript Ajax Programming Web Programming /38.
CHAPTER 13 COMMUNICATING WITH AJAX. LEARNING OBJECTIVES AJAX, which stands for Asynchronous JavaScript and XMLprovides a way for a browser to send and.
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
What is AJAX ? Asynchronous Javascript and XML. Not a stand-alone language or technology. It is a technique that combines a set of known technologies in.
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
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..
Introduction to AJAX MIS 3502, Spring 2016 Jeremy Shafer Department of MIS Fox School of Business Temple University 2/4/2016.
Ajax! Ajax Programming Ajax! Ajax Programming. Ajax! Ajax Programming Take a look at a typical desktop application (Spreadsheet app, etc.) The program.
JavaScript and Ajax Week 10 Web site:
NCCUCS 軟體工程概論 Lecture 5: Ajax, Mashups April 29, 2014.
Ajax SUBMITTED BY NITIN RAMANI C.S.E 3 rd Y 5 th S R.N CS SUBMITTED TO PRO. PUSHPARAJ PATEL SIR.
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)
AJAX AJAX = Asynchronous JavaScript and XML.
CS 371 Web Application Programming
AJAX and REST.
AJAX.
Introduction to AJAX MIS 3502 Jeremy Shafer Department of MIS
AJAX and JSP ISYS 350.
Google Maps: A Short How-to
Introduction to AJAX MIS 3502 Jeremy Shafer Department of MIS
JavaScript & AJAX.
COP 3813 Intro to Internet Computing
DR. JOHN ABRAHAM PROFESSOR UTPA
Web Technology Even Sem 2015
AJAX and JSP ISYS 350.
AJAX By Prof. B.A.Khivsara
Presentation transcript:

Introduction to Ajax Professor Stephen K. Kwan MIS, College of Business San José State University Asynchronous JavaScript and XML © Stephen. K. Kwan 2009

Web Applications A Client/Server Computing Model ClientComputerBrowserServerComputerHTTPService HTTP REQUEST HTTP RESPONSE (URL,Post,Get,parameters,..) (XHTML,contents,...) ( A Generic Diagram ) A State-less Environment

XHTML HTML StyleSheets XML CascadingStyleSheets(CSS)ExtensibleStylesheetLanguage(XSL) StructureFormatContent Dynamic JavaScript & DocumentObjectModel(DOM)

Web Applications ClientBrowser (state A) HTTPServer HTTP REQUEST HTTP RESPONSE New Page Default Synchronous Processing Scenario ClientBrowser (state B) e.g. SJSU A State-less Environment (state A) (state A + … = state B)

ClientBrowser (state D) Web Applications ClientBrowser (state A) HTTPServer REQUEST RESPONSE – RESPONSE – New Page Asynchronous Processing Scenario ClientBrowser (state C) ClientBrowser (state B) REQUEST/RESPONSE REQUEST/RESPONSE Using XMLHttpRequest Object

Examples Google Map (SJSU) 1. Google Map (SJSU) 2. Google Map (Neighborhood 1) 3. Google Map (Neighborhood 2) 4. NetFlix.com 5. Worklife Survey (old tooltip) 6. MUSE Calendar (regular) 7. MUSE Calendar (Ajax tooltip) 8. (Ajax) Go 1 Go 2 Go 3 Go 4 Go 6 Go 7 Go 8 Go 5

Google Map APIs Sign up for Google Map APIs: Documentation and Sample Codes Some Additional Resources & Samples On Line

Google Map Example <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" " <html xmlns=" xmlns:v="urn:schemas-microsoft-com:vml"> v\:* { behavior:url(#default#VML); } 1. Initial Set up 2. Define Functions (not shown here) (see source file for correct sequence of statements)

3. What the HTML looks like: Five Wounds/Brookwood Terrace Neighborhood Clear Show

4. On Load of web page draw map function onLoad(){ map = new GMap(document.getElementById("map")); map.addControl(new GSmallMapControl()); map.addControl(new GMapTypeControl()); GEvent.addListener(map, "moveend", function() { var center = map.getCenterLatLng(); var latLngStr = 'Center: (' + center.y + ', ' + center.x + ')'; document.getElementById("message").innerHTML = latLngStr; }); map.centerAndZoom (new GPoint ( , ), 3);

4. Use Ajax to get XML file of points var request = GXmlHttp.create(); request.open("GET", "data2.xml", true);

request.onreadystatechange = function() {if (request.readyState == 4) {var xmlDoc = request.responseXML; var markers = xmlDoc.documentElement.getElementsByTagName("marker"); for (var i = 0; i < markers.length; i++) {var point = new GPoint(parseFloat(markers[i].getAttribute("lng")), parseFloat(markers[i].getAttribute("lat"))); points[i]=point; } } points.push(points[0]); ShowLine(); } request.send(null); } function ShowLine() { map.addOverlay(new GPolyline(points));} 5. When file is ready, parse coordinates from XML and create a points array. Draw line connecting points. Try It!

Tool Tip Example var xmlHttp; var tipText; function createXMLHttpRequest() { if (window.ActiveXObject) { xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); } else if (window.XMLHttpRequest) { xmlHttp = new XMLHttpRequest(); } } function doRequestUsingGET(Q) { createXMLHttpRequest(); xmlHttp.onreadystatechange = handleStateChange; xmlHttp.open("GET", Q, true); xmlHttp.send(null); } function handleStateChange() { if(xmlHttp.readyState == 4) { if(xmlHttp.status == 200) { tipText=xmlHttp.responseText; } } } Try It!

How to start? Learn JavaScript and how to work with DOM Sign up for Google Map APIs Study the Google Map documentation and try Take advantage of online resources (lots) Get a book to read and learn from the code: R. Asleson and N. Schutta Foundations of Ajax, Apress, R. Crane, E. Pascarello, D. James Ajax in Action, Manning, End