AJAX – Asynchronous JavaScript And XML By Kranthi Kiran Nuthi CIS 764 Kansas State 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.
1 JavaScript & AJAX CS , Spring JavaScript.
Using AJAX Galip Aydin, Ahmet Sayar, and Marlon Pierce Community Grids Lab Indiana University.
Chapter 6 DOJO TOOLKITS. Objectives Discuss XML DOM Discuss JSON Discuss Ajax Response in XML, HTML, JSON, and Other Data Type.
Introduction to AJAX AJAX Keywords: JavaScript and XML
PHP and AJAX ISYS 475. AJAX Asynchronous JavaScript and XML: – JavaScript, Document Object Model, Cascade Style Sheet, XML, server-side script such as.Net,
CS 4720 RESTfulness and AJAX CS 4720 – Web & Mobile Systems.
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.
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.
J.Holvikivi 1 Ajax & scripts Jaana Holvikivi Metropolia.
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.
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)
Ajax. –Asynchronous JavaScript and XML –Umbrella term for technologies that often: Use client-side scripting for layout and formatting Use less than full.
-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:
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.
AJAX Asynchronous JavaScript and XML 1. AJAX Outline What is AJAX? Benefits Real world examples How it works 2.
JQuery and AJAX WEB Technologies : PHP Programming Language.
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.
JavaScript & Introduction to AJAX
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.
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 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 & Client-side Dynamic Web Gunwoo Park (Undergraduate)
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 – Asynchronous JavaScript and XML
AJAX.
Prepared for Md. Zakir Hossain Lecturer, CSE, DUET Prepared by Miton Chandra Datta
CSE 154 Lecture 11: AJAx.
CSE 154 Lecture 22: AJAX.
COP 3813 Intro to Internet Computing
Introduction to AJAX Sue Brandreth.
JavaScript & jQuery AJAX.
AJAX CS-422 Dick Steflik.
Chengyu Sun California State University, Los Angeles
Chengyu Sun California State University, Los Angeles
AJAX By Prof. B.A.Khivsara
Presentation transcript:

AJAX – Asynchronous JavaScript And XML By Kranthi Kiran Nuthi CIS 764 Kansas State University

Overview What is AJAX ? Why AJAX ? AJAX Vs Classical Web Approach. How AJAX Works ? XMLHttpRequest ? How to make an AJAX application ? Live AJAX Examples.

What is AJAX ? Ajax isn’t a new technology or programming language. It is a technique used to develop interactive web applications that are able to process a user request immediately. Ajax can selectively modify a part of a page displayed by the browser, and update it without the need to reload the whole document with all images, menus, etc.

What is AJAX ?(cont) Asynchronous The word "Asynchronous" in AJAX means that the request to the server will be made. The response will be made available by the server after it has finished processing the request, without having to wait for it explicitly, to come back. i.e. you don’t have to wait for an answer.

Why AJAX? The common problem is WebPages always “RELOAD” and never get “UPDATED”, creating a break in user interaction. Users wait for the entire page to load even if a single piece of data is needed Restriction on single Request/Response. Need for complicated UI components.

Technologies Involved JavaScript – for binding everything together. HTML & Cascading Style Sheets (CSS), for presentation and to provide style classes for the component styling. XMLHttpRequest – provides asynchronous data retrieval. Document Object Model (DOM), for dynamic display and interaction and provides a tree structure for the components placed in the web page. Extensible Markup Language (XML), Format to send data from client to server, though other formats like JSON may also be used.

AJAX approach Vs Classical approach Diagram Reference :

AJAX approach Vs Classical approach (Cont) Diagram reference: ivepath.co m

How AJAX Works ? A JavaScript function creates and configures an XMLHttpRequest object on the client, and specifies a JavaScript callback function. The XMLHttpRequest object makes an asynchronous call to the web server. The web server processes the request and returns an XML document that contains the result. The XMLHttpRequest object calls the callback function and exposes the response from the web server so that the request can be processed. The client updates the HTML DOM representing the page with the new data.

How AJAX Works ? (cont)

XMLHttpRequest ? XMLHttpRequest object is the key to Ajax programming. It’s main purpose is to put an asynchronous http request to the web server. Because of this asynchronous call to the web server, you are allowed to continue using the page without the interruption of a browser refresh and the loading of a new or revised page. This object has few properties.

Properties of XMLHttpRequest Property 1: objXMLHttp. onreadystatechange This property holds the reference of function which is going to process the response from the server. objXMLHttp.onreadystatechange = procRequest; * "procRequest " is the function which will process the response

Properties of XMLHttpRequest Property 2 : objXMLHttp. readyState This property holds the status of server response. objXMLHttp.readyState = [state]; State Description 0The request is not initialized 1The request has been set up 2The request has been sent 3The request is in process 4The request is complete

Properties of XMLHttpRequest Property 3: objXMLHttp.responseText This property retrieves the data sent back from server. var objVal = objXMLHttp. responseText; While the responseText is used to return text, responseXML can be used to return an XML document object. var xmlDoc; xmlDoc = objXMLHttp.responseXML.documentElement

How to make an Ajax application ? Ajax at work var XMLHttpRequestObject = false; if (window.XMLHttpRequest) { XMLHttpRequestObject = new XMLHttpRequest(); //for mozilla } else if (window.ActiveXObject) { XMLHttpRequestObject = new ActiveXObject("Microsoft.XMLHTTP"); // IE } function getData(dataSource, divID) { if(XMLHttpRequestObject) { var obj = document.getElementById(divID); XMLHttpRequestObject.open("GET", dataSource); XMLHttpRequestObject.onreadystatechange = function() { if (XMLHttpRequestObject.readyState == 4 && XMLHttpRequestObject.status == 200) { obj.innerHTML = XMLHttpRequestObject.responseText

Sample Code (cont) } } XMLHttpRequestObject.send(null); } Fetching data with Ajax <input type = "button" value = "Display Message" on click = "getData('data.txt', 'targetDiv')“ > The fetched data will go here.

Live Examples of AJAX Google suggest is a simple google application which uses Ajax. Google

References rchives/ php rchives/ php / / AX AX

Thank you & Questions