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.

Slides:



Advertisements
Similar presentations
Lecture 11 Server Side Interaction
Advertisements

9. AJAX & RIA. 2 Motto: O! call back yesterday, bid time return. — William Shakespeare.
AJAX – The Future of Web Development? Anders Moberg David Mörtsell David Södermark.
AJAX Presented by: Dickson Fu Dimas Ariawan Niels Andreassen Ryan Dial Jordan Nielson CMPUT 410 University of Alberta 2006.
IS 360 Course Introduction. Slide 2 What you will Learn (1) The role of Web servers and clients How to create HTML, XHTML, and HTML 5 pages suitable for.
AJAX asynchronous server-client communication. Test.
Ajax Dr Jim Briggs WEBP Ajax1. 2 Ajax Asynchronous JavaScript And XML Method of creating more interactive web applications Moves more of the application.
Cloud Computing Lecture #7 Introduction to Ajax Jimmy Lin The iSchool University of Maryland Wednesday, October 15, 2008 This work is licensed under a.
Chapter 6 DOJO TOOLKITS. Objectives Discuss XML DOM Discuss JSON Discuss Ajax Response in XML, HTML, JSON, and Other Data Type.
Prof. James A. Landay University of Washington Spring 2008 Web Interface Design, Prototyping, and Implementation Rich Internet Applications: AJAX, Server.
The Document Object Model (DOM) & Asynchronous Javascript And XML (AJAX) : an introduction UFCEKG-20-2 : Data, Schemas and Applications.
CGI and AJAX CS-260 Dick Steflik.
JavaScript & jQuery the missing manual Chapter 11
Ruth Betcher Ruth Christie
Lecture 12 – AJAX SFDV3011 – Advanced Web Development Reference: 1.
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.
Chapter 17 - Deploying Java Applications on the Web1 Chapter 17 Deploying Java Applications on the Web.
Posting XML Data From the Client to a Server Eugenia Fernandez IUPUI.
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:
06/10/2015AJAX 1. 2 Introduction All material from AJAX – what is it? Traditional web pages and operation Examples of AJAX use Creating.
Telerik Software Academy ASP.NET Web Forms Telerik Software Academy ASP.NET Web Forms.
Lecture 9: AJAX, Javascript review..  AJAX  Synchronous vs. asynchronous browsing.  Refreshing only “part of a page” from a URL.  Frameworks: Prototype,
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.
CISC 3140 (CIS 20.2) Design & Implementation of Software Application II Instructor : M. Meyer Address: Course Page:
Chapter 16: Ajax-Enabled Rich Internet Applications with XML and JSON TP2543 Web Programming Mohammad Faidzul Nasrudin.
INT222 - Internet Fundamentals Shi, Yue (Sunny) Office: T2095 SENECA COLLEGE.
JQuery and AJAX WEB Technologies : PHP Programming Language.
SE-2840 Dr. Mark L. Hornick 1 Introduction to Ajax Asynchronous Javascript And XML.
AJAX. Ajax  $.get  $.post  $.getJSON  $.ajax  json and xml  Looping over data results, success and error callbacks.
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…
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.
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.
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?
1 AJAX. AJAX – Whatzit? Asynchronous (content loading)‏ Javascript (logic & control)‏ And XML (request handling)‏
JavaScript, Sixth Edition Chapter 11 Updating Web Pages with Ajax.
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.
Open Solutions for a Changing World™ Eddy Kleinjan Copyright 2005, Data Access WordwideNew Techniques for Building Web Applications June 6-9, 2005 Key.
National College of Science & Information Technology.
The Mechanics of HTTP Requests and Responses and network connections.
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)
Not a Language but a series of techniques
AJAX AJAX = Asynchronous JavaScript and XML.
WEB SERVICES.
AJAX and REST.
AJAX.
Ajax Design Patterns – Programming Practices in Web Services
AJAX.
Web System & Technology
JavaScript & AJAX.
JavaScript & jQuery AJAX.
Secure Web Programming
MIS JavaScript and API Workshop (Part 3)
AJAX CS-422 Dick Steflik.
Intro to Ajax Fred Stluka Jan 25, 2006.
Chengyu Sun California State University, Los Angeles
Web Technologies Computing Science Thompson Rivers University
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 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 single technology but several HTML / CSS / DOM / XML It’s used to dynamically update Web pages or at least parts of them

Slide 3 What is AJAX? It uses the HTTPRequest and HTTPResponse objects to Make a server request from client JavaScript And process the server-side response

Slide 4 AJAX (model) From W3Schools.com

Slide 5 AJAX Frameworks Most vendors have their own AJAX abstraction layers ASP has a script manager and an AJAX toolkit It’s a layer on top of AJAX There are several for PHP Phery, CJAX, Quicknet There are frameworks for Python, Perl, Ruby and others

Slide 6 RestFull APIs These are generally available APIs that accept and execute AJAX requests, and return data to the client Yahoo has YQL SQL-like queries are built into the URL (GET request) I’ll show this in class

Slide 7 RestFull APIS Google has a number of APIs These typically use JSON JSON is an alternative to moving the responses around as XML Easier to process with JavaScript

Slide 8 AJAX (The Mechanics) The XMLHttpRequest object is used to create a request The request gets configured with the open method The request gets sent with the send method The responseText and responseXML properties store the returned information Use the onreadystatechange event for async requests

Slide 9 AJAX XMLHttpRequest The following creates the request var req = new XMLHttpRequest(); The open method define the type of request The first argument contains the method to use (GET or POST) The second argument contains the URL The third argument contains true (asynchronous) or false (synchronous) The send method sends the request to the server

Slide 10 AJAX XMLHttpRequest (Example) Create open and send a synchronous request

Slide 11 AJAX Response (Synchronous) When the request completes, we get at the response through the following properties of the XMLHttpRequest object responseText – gets the response data as a string responseXML gets the response data as XML, which we can then parse using the DOM This is the same DOM we talked about with regard to the HTML document

Slide 12 AJAX Response (Synchronous)

Slide 13 AJAX Response (Asynchronous) The onreadystatechanged event fires as the request progresses Initialize Loading Loaded Interactive Completed Status and status contain the result status information 404 – not found / 200 success

Slide 14 AJAX Response (Asynchronous)

Slide 15 AJAX (jQuery) As usual, jQuery makes the process simple although the syntax is obscure

Slide 16 A Few Words about XML It’s the extensible markup language Data is frequently stored and transported as XML It looks like XHTML 5 Tags, attributes and elements Nesting concepts are the same However the tag and attribute names can be any valid name.NET knows about them

Slide 17 A Few Words about XML Sample XML document

Slide 18 REST Acronym for Representational State Transfer REST (restful Web services) is a way of exchanging HTTP requests and responses between client and server It’s an alternative to Web Services and SOAP It’s an alternative to Remote Procedure Calls (RPC)

Slide 19 REST For read requests we Send all data to the server via a URL and GET request URLs are logical locations, rather than physical resources (a file at the end of the URL) Data is typically returned as XML It’s not a standard but a way of doing things An architecture of style YQL is restful

Slide 20 A Few Words about YQL Yahoo Query Language Implemented as a Web service, they maintain a number of tables Finance Geography and many more opentables-chapter.html# opentables-chapter.html#

Slide 21 AJAX (References) us/library/bb aspx us/library/bb aspx