Ajax SUBMITTED BY NITIN RAMANI C.S.E 3 rd Y 5 th S R.N - 0712CS071049 SUBMITTED TO PRO. PUSHPARAJ PATEL SIR.

Slides:



Advertisements
Similar presentations
AJAX Presented by: Dickson Fu Dimas Ariawan Niels Andreassen Ryan Dial Jordan Nielson CMPUT 410 University of Alberta 2006.
Advertisements

1 CS 3870/CS 5870 Static and Dynamic Web Pages ASP.NET and IIS.
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.
CGI and AJAX CS-260 Dick Steflik.
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
1 CS 3870/CS 5870 Static and Dynamic Web Pages ASP.NET and IIS.
11/13/2007 A synchronous J avaScript A nd X ML Gloria Law Joshua Mahaz.
CSCI 6962: Server-side Design and Programming Introduction to AJAX.
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.
06/10/2015AJAX 1. 2 Introduction All material from AJAX – what is it? Traditional web pages and operation Examples of AJAX use Creating.
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.
Active Server Pages  In this chapter, you will learn:  How browsers and servers interacted on the Internet when the Internet first became popular 
AJAX محمد احمدی نیا 2 Of 27 What is AJAX?  AJAX = Asynchronous JavaScript and XML.  AJAX is not a new programming language, but.
Fall 2006 Florida Atlantic University Department of Computer Science & Engineering COP 4814 – Web Services Dr. Roy Levow Part 2 – Ajax Fundamentals.
Web Architecture Introduction
Introduction to JavaScript CS101 Introduction to Computing.
Ajax XMod for Dummies Building DNN Ajax Modules Without Programming Dave McMullen SoCal DNN Users Group 2/7/07 –
Asynchronous Javascript And XML AJAX : an introduction UFCEUS-20-2 : Web Programming.
AJAX stands for Asynchronous JavaScript And XML. AJAX is a type of programming made popular in 2005 by Google (with Google Suggest). AJAX is not a new.
ASP (Active Server Pages) by Bülent & Resul. Presentation Outline Introduction What is an ASP file? How does ASP work? What can ASP do? Differences Between.
Web Technology Introduction AJAXAJAX. AJAX Outline  What is AJAX?  Benefits  Real world examples  How it works  Code review  Samples.
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.
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.
 Web pages originally static  Page is delivered exactly as stored on server  Same information displayed for all users, from all contexts  Dynamic.
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.
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.
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.
Introduction to AJAX Sue Brandreth. What is Ajax?
AJAX – Asynchronous JavaScript And XML By Kranthi Kiran Nuthi CIS 764 Kansas State University.
 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?
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.
Open Solutions for a Changing World™ Eddy Kleinjan Copyright 2005, Data Access WordwideNew Techniques for Building Web Applications June 6-9, 2005 Key.
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.
JavaScript and Ajax (Ajax Tutorial)
Not a Language but a series of techniques
AJAX AJAX = Asynchronous JavaScript and XML.
CS 371 Web Application Programming
AJAX and REST.
Section 17.1 Section 17.2 Add an audio file using HTML
XMLHttp Object.
AJAX.
AJAX.
PHP / MySQL Introduction
Web System & Technology
AJAX and JSP ISYS 350.
Client side & Server side scripting
AJAX Robin Burke ECT 360.
ISC440: Web Programming 2 AJAX
Introduction to AJAX Sue Brandreth.
JavaScript & jQuery AJAX.
AJAX CS-422 Dick Steflik.
Web Technology Even Sem 2015
AJAX and JSP ISYS 350.
Presentation transcript:

Ajax SUBMITTED BY NITIN RAMANI C.S.E 3 rd Y 5 th S R.N CS SUBMITTED TO PRO. PUSHPARAJ PATEL SIR

 INTRODUCTION  PURPOSE  TECHNOLOGIES USED  DATA EXCHANGE/  HISTORY  STRUCTURE OF SYSTEM AND C/S PROCESS  ADVANTAGES  DISADVANTAGES Contents

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 order to create faster and more user friendly web pages. It is a client side technology.

Purpose of AJAX Prevents unnecessary reloading of a page. When we submit a form, although most of the page remains the same, whole page is reloaded from the server. This causes very long waiting times and waste of bandwidth. AJAX aims at loading only the necessary innformation, and making only the necessary changes on the current page without reloading the whole page.

Technologies Used AJAX uses: AJAX uses: Javascript (for altering the page) XML (for information exchange) ASP or JSP (server side)

Simple Processing AJAX is based on Javascript, and the main functionality is to access the web server inside the Javascript code. We access to the server using special objects; we send data and retrieve data. When user initiates an event, a javascript function is called which accesses server using the objects. The received information is shown to the user by means of the Javascript’s function s.

Example We want to input data into a textbox. We want the textbox to have intellisense property; guess entries according to input. sp sp Only the ‘span’ part of the html code is changed.

Data Exchange in AJAX In AJAX:

Example(2) Another example: Therefore, by using AJAX, unnecessary exchange of data is prevented, web pages become: More interactive Faster More user friendly

History of AJAX Starts with web pages Starts with web pages Static web pages Static web pages Static html page is loaded No interaction with user Dynamic web pages Dynamic web pages Html page is generated dynamically Interaction with user Becomes slower as functionality increases Speed becomes untolerable, so AJAX has been born

Alternative Technologies Not a technology, but a combination of technologies. Technologies with similar tasks: URLConnection, ASP and JSP Other technologies returns whole page and client loads it. Only necessary data is returned and that part is updated

Structure of System Client/Server architecture XMLHTTP object is used to make request and get response in Client side Request can be done via “GET” or “POST” methods “GET”: parameters are attached to the url used to connect. “POST”: parameters are sent as parameters to a function Not many changes in Server side Response is a combination of xml tags

C/S Processes Most of the time client requires two files Most of the time client requires two files Html page: handles GUI and calls a function of JavaScript. Html page: handles GUI and calls a function of JavaScript. JavaScript: handles the business logic of the system JavaScript: handles the business logic of the system In JavaScript, a request is sent to client and response is taken from server via XMLHTTP object In JavaScript, a request is sent to client and response is taken from server via XMLHTTP object Response of server should be returned in xml file structure Response of server should be returned in xml file structure Only requested data is returned Only requested data is returned

Examination of Sample General process will be explained on an example at General process will be explained on an example at In this example, one html page and one JavaSocket reside in Client side of the system while an ASP page resides in Server sides In this example, one html page and one JavaSocket reside in Client side of the system while an ASP page resides in Server sides.

Html Code of Example Select a Customer: Alfreds Futterkiste North/South Wolski Zajazd Customer info will be listed here.

JavaScript of Example function showCustomer(str) { var url="getcustomer.asp?sid=" + Math.random() + "&q=" + str xmlHttp=GetXmlHttpObject(stateChanged) xmlHttp.open("GET", url, true) xmlHttp.send(null) } function stateChanged() { if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ document.getElementById("txtHint").innerHTML = \ xmlHttp.responseText }

ASP Code of Example sql="SELECT * FROM CUSTOMERS WHERE CUSTOMERID=" sql=sql & request.querystring("q") Open Connection to the DB rs.Open sql, conn response.write(" ") do until rs.EOF for each x in rs.Fields response.write(" " & x.name & " ") response.write(" & x.value & " ") next rs.MoveNext loop response.write(" ")

XMLHTTP Object The object that is used to connect to the remote server is called XMLHTTP. The object that is used to connect to the remote server is called XMLHTTP. It resembles the Java’s URL object that is used to access a specific URL and get the contents. It resembles the Java’s URL object that is used to access a specific URL and get the contents.

Creating the object For IE 5.5: For IE 5.5: objXmlHttp=new ActiveXObject(“Microsoft.XMLHTTP”) objXmlHttp=new ActiveXObject(“Microsoft.XMLHTTP”) For Mozilla: For Mozilla: objXmlHttp=new XMLHttpRequest() objXmlHttp=new XMLHttpRequest()

Sending information After creating the object, we can send information to the web server and get the answer using this object’s functions: After creating the object, we can send information to the web server and get the answer using this object’s functions: GET METHOD: xmlhttp.open(“GET”, url, true) GET METHOD: xmlhttp.open(“GET”, url, true) xmlhttp.send() xmlhttp.send() POST METHOD: xmlhttp.open("POST", url, true) POST METHOD: xmlhttp.open("POST", url, true) xmlhttp.send(“date= &name=Ali") xmlhttp.send(“date= &name=Ali") Third argument tells that data will be processes asynchronously. When server responds, the “OnReadyStateChange” event handler will be called. Third argument tells that data will be processes asynchronously. When server responds, the “OnReadyStateChange” event handler will be called.

Retrieving information We get the returned value with the property “xmlHttp.responseText”. We get the returned value with the property “xmlHttp.responseText”.

Pros/Cons Advantages: Advantages: Independent of server technology. Independent of server technology. Apart from obtaining the XMLHTTP object, all processing is same for all browser types, because Javascript is used. Apart from obtaining the XMLHTTP object, all processing is same for all browser types, because Javascript is used. Permits the development of faster and more interactive web applications. Permits the development of faster and more interactive web applications. Disadvantages: Disadvantages: The back button problem. People think that when they press back button, they will return to the last change they made, but in AJAX this doesn not hold. The back button problem. People think that when they press back button, they will return to the last change they made, but in AJAX this doesn not hold. Possible network latency problems. People should be given feedback about the processing. Possible network latency problems. People should be given feedback about the processing. Does not run on all browsers. Does not run on all browsers.

Questions and Answers Any questions ? Thank you for your time