AJAX and REST.

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 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
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.
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.
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.
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.
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 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:
Ajax SUBMITTED BY NITIN RAMANI C.S.E 3 rd Y 5 th S R.N CS SUBMITTED TO PRO. PUSHPARAJ PATEL SIR.
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.
What is AJAX ? Asynchronous Javascript and XML.
Web Technologies Computing Science Thompson Rivers University
JavaScript and Ajax (Ajax Tutorial)
Not a Language but a series of techniques
AJAX AJAX = Asynchronous JavaScript and XML.
WEB SERVICES.
Unit – 5 JAVA Web Services
AJAX.
Asynchronous Java script And XML Technology
Ajax Design Patterns – Programming Practices in Web Services
AJAX.
Web System & Technology
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.
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.
DR. JOHN ABRAHAM PROFESSOR UTPA
Chengyu Sun California State University, Los Angeles
Web Technologies Computing Science Thompson Rivers University
Introduction to AJAX and JSON
Ajax and JSON Jeremy Shafer Department of MIS Fox School of Business
Client-Server Model: Requesting a Web Page
Chengyu Sun California State University, Los Angeles
Ajax and JSON Jeremy Shafer Department of MIS Fox School of Business
Presentation transcript:

AJAX and REST

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

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

AJAX (model) From W3Schools.com

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

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

RestFull APIS Google has a number of APIs These use JSON typically JSON is an alternative to moving the responses around as XML

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

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

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

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

AJAX Response (Synchronous)

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

AJAX Response (Asynchronous)

AJAX (jQuery) As usual, jQuery makes the process simple

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

A Few Words about XML Sample XML document

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)

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

A Few Words about YQL Yahoo Query Language Implemented as a Web service, they maintain a number of tables Finance Geography and many more http://developer.yahoo.com/yql/guide/yql-opentables-chapter.html#

AJAX (References) http://w3schools.com/ajax/default.asp http://msdn.microsoft.com/en-us/library/bb924552.aspx http://developer.yahoo.com/yql/

HTML 5 http://www.ibm.com/developerworks/library/x-html5/