Using AJAX Galip Aydin, Ahmet Sayar, and Marlon Pierce Community Grids Lab Indiana University.

Slides:



Advertisements
Similar presentations
6/3/2015eBiquity1 Tutorial on AJAX Anubhav Kale (akale1 AT cs DOT umbc DOT edu)
Advertisements

AJAX Presented by: Dickson Fu Dimas Ariawan Niels Andreassen Ryan Dial Jordan Nielson CMPUT 410 University of Alberta 2006.
AJAX asynchronous server-client communication. Test.
Does Ajax suck? CS575 Spring 2007 Chanwit Suebsureekul.
Writing All Your Code In OpenEdge Architect Peter van Dam.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
Internet Applications Spring Review Last week –MySQL –Questions?
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.
PHP and AJAX ISYS 475. AJAX Asynchronous JavaScript and XML: – JavaScript, Document Object Model, Cascade Style Sheet, XML, server-side script such as.Net,
JavaScript & jQuery the missing manual Chapter 11
Lecture 12 – AJAX SFDV3011 – Advanced Web Development Reference: 1.
ASP.NET + Ajax Jesper Tørresø ITNET2 F08. Ajax Ajax (Asynchronous JavaScript and XML) A group of interrelated web development techniques used for creating.
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:
Matrix Mapping Tool Sam Gross Internship at Virtual Technology Corporation.
06/10/2015AJAX 1. 2 Introduction All material from AJAX – what is it? Traditional web pages and operation Examples of AJAX use Creating.
Client side web programming Introduction Jaana Holvikivi, DSc. School of ICT.
J.Holvikivi 1 Ajax & scripts Jaana Holvikivi Metropolia.
Random Logic l Forum.NET l AJAX Behind the buzz word Forum.NET ● January 23, 2006.
Lecture 9: AJAX, Javascript review..  AJAX  Synchronous vs. asynchronous browsing.  Refreshing only “part of a page” from a URL.  Frameworks: Prototype,
AJAX محمد احمدی نیا 2 Of 27 What is AJAX?  AJAX = Asynchronous JavaScript and XML.  AJAX is not a new programming language, but.
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.
SensorGrid Galip Aydin June SensorGrid A flexible computing environment for coupling real-time data sources to High Performance Geographic Information.
-By V.Gouthaman. INTRODUCTION Ajax (shorthand for asynchronous JavaScript and XML) is a group of interrelated web development techniques used on the client-side.
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.
CISC 3140 (CIS 20.2) Design & Implementation of Software Application II Instructor : M. Meyer Address: Course Page:
1 MESSAGE EXCHANGE FOR Web Service-Based Mapping Services AHMET SAYAR INDIANA UNIVERSITY COMMUNITY GRIDS LAB. COMPUTER SCIENCE DEPARTMENT August 17, 2005.
the acronym for Asynchronous JavaScript and XML.
INT222 - Internet Fundamentals Shi, Yue (Sunny) Office: T2095 SENECA COLLEGE.
AJAX Asynchronous JavaScript and XML 1. AJAX Outline What is AJAX? Benefits Real world examples How it works 2.
SE-2840 Dr. Mark L. Hornick 1 Introduction to Ajax Asynchronous Javascript And XML.
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.
CHAPTER 8 AJAX & JSON WHAT IS AJAX? Ajax lets you…
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
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
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.
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. Objectives Understand and apply AJAX Using AJAX in DOJO library.
Ajax SUBMITTED BY NITIN RAMANI C.S.E 3 rd Y 5 th S R.N CS SUBMITTED TO PRO. PUSHPARAJ PATEL SIR.
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.
CS 371 Web Application Programming
AJAX and REST.
AJAX.
AJAX.
CSE 154 Lecture 11: AJAx.
CSE 154 Lecture 22: AJAX.
ISC440: Web Programming 2 AJAX
JavaScript & jQuery AJAX.
AJAX CS-422 Dick Steflik.
Intro to Ajax Fred Stluka Jan 25, 2006.
Chengyu Sun California State University, Los Angeles
Chengyu Sun California State University, Los Angeles
AJAX By Prof. B.A.Khivsara
Presentation transcript:

Using AJAX Galip Aydin, Ahmet Sayar, and Marlon Pierce Community Grids Lab Indiana University

What Is AJAX? Asynchronous JavaScript and XML is a combination of standard Web technologies –JavaScript, CSS, DOM, XML When done properly, it provides apparently seamless interactivity in browser clients. –No browser reloads –Much smoother than standard request-wait-response for browser forms. Several Google tools are a very well known examples. –Google maps, Gmail, etc. The real key is the standardization of the XMLHttpRequest Object –Originally developed for Internet Explorer –Now supported by all major browsers. Seminal article from Adaptive Path – phttp:// p

AJAX Architecture Taken from

The Main Idea: Asynchronous JavaScript Calls to Server AJAX’s key concept is the use of XMLHttpRequest to buffer requests and responses within the browser. –Use XMLHttpRequest to make a call to the server and get back the response without displaying it. –The response is stored locally as either plain text (plain or HTML), or XML. –JavaScript + DOM can be used to walk the HTML or XML tree to handle most user interactions. The XMLHttpRequest object in turn can issue requests and process responses independently of the user’s interaction. –Go and fetch additional maps, for example.

Asynchronous Invocations

How it Works

Simple Example: GIS and Google Maps The Web Feature Service is a standard geographical information system service. –It stores geographic features and metadata used to construct maps. –Features are represented with the Geographic Markup Language –For example, the location and properties of earthquake faults and seismic events. The Feature Service is typically constructed around traditional request-response. We would like to combine this with Google Maps to make more interactive user interfaces. So let’s get started.

Integrating Google Maps and GIS Services Simple Architecture Supported Feature Data by the WFS Layer specific parameters for filtering

Making the request Creating an XMLHttpRequest Object –For any browser, except IE var requester = new XMLHttpRequest(); –In IE var requester = new ActiveXObject("Microsoft.XMLHTTP"); Transporting Data using an XMLHttpRequest Object –To retrieve data from the server we use two methods : open() to initialize the connection, send() to activate the connection and make the request. requester.open("GET", "getFaultNames.jsp?State=CA"); requester.send(null); This request is for all California fault information in the Feature Service. –It will be encoded in GML –It may take a bit of time to download….

Checking the Connection Status To find out if the data retrieval is done we check the status of the readyState variable. Object’s status may be any of the following: 0 – Uninitialised 1 – Loading 2 – Loaded 3 – Interactive 4 – Completed –requester.onreadystatechange monitors the readyState variables status. if (requester.readyState == 4){ if (requester.status == 200){ success(); } else{ failure(); }

Parsing the Data After a successful request XMLHttpRequest object may hold data in one of the two properties: responseXML or responseText. responseXML stores a DOM-structured XML data. San Andreas We use JavaScript XML parsing methods such as getElementsByTagName(), childNodes[], parentNode… var faultNameNode = requester.responseXML.getElementsByTagName(“Name")[0]; var faultName = faultNameNode.childNodes[0].nodeValue; We can then use Google Map JavaScript functions to create the browser display. responseText stores the data as one complete string in case the content type of the data supplied by the server was text/plain or text/html.

Ajax Calls From JSP Pages In the 1 st JSP page function checkForMessage() { var url = "relay.jsp"; initRequest(url); req.onreadystatechange = processReqChange; req.open("GET", url, true); req.send(null); } The request is forwarded to relay.jsp In the 2 nd JSP page (relay.jsp) <% Bean.getNames(response); %> The response object will contain the XML result object.

Integrating Web Feature Service Archives and Google Maps Google maps can be integrated with Web Feature Service Archives to browse earthquake fault records. Faults are typically stored by segment number, so map interfaces are convenient for both verifying continuity and setting up input files for computing problems.

Other Useful Examples AJAX is also useful for simulating server data pushing. –Browser interface is updated periodically from locally stored data. –XMLHttpRequest periodically requests updates asyncrhonously. Replace annoying browser reload polling and fragile, non-standard server push. The browser is always available for user interactions while the XMLHttpRequest object is being updated. Examples: Chat applications and GPS streams

Real Time GPS and Google Maps Subscribe to live GPS station. Position data from SOPAC is combined with Google map clients. Select and zoom to GPS station location, click icons for more information.