Top Banner
AJAX Abhilasha Lahigude.
13

AJAX

Dec 17, 2014

Download

Engineering

"AJAX = Asynchronous JavaScript and XML.
AJAX is a technique for creating fast and dynamic web pages.
AJAX allows web pages to be updated asynchronously by exchanging small amounts of data with the server behind the scenes. This means that it is possible to update parts of a web page, without reloading the whole page.
Classic web pages, (which do not use AJAX) must reload the entire page if the content should change.
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: AJAX

AJAX

Abhilasha Lahigude.

Page 2: AJAX

WHAT IS AJAX?

"AJAX = Asynchronous JavaScript and XML. AJAX is a technique for creating fast and

dynamic web pages. AJAX allows web pages to be updated

asynchronously by exchanging small amounts of data with the server behind the scenes. This means that it is possible to update parts of a web page, without reloading the whole page.

Classic web pages, (which do not use AJAX) must reload the entire page if the content should change.

Page 3: AJAX

WHY USE AJAX?

Very user-visible effect Rich UI experience in a Web page Portable across browsers Plus, all advantages of zero-install Web app Ajax Apps:

Dynamic dataStatic or dynamic forms, controls, code,

etc.Best of both worlds

Page 4: AJAX

CLASSIC VS AJAX

Page 5: AJAX

SOME EXAMPLESLogin forms Google Suggest

Chat Rooms And Instant Messaging

Lightboxes instead of pop-ups

Page 6: AJAX

HOW AJAX WORKS

Page 7: AJAX

HOW TO USE AJAX?The typical method for using Ajax is the following:

A JavaScript creates an XMLHttpRequest object, initializes it with relevant information as necessary, and sends it to the server. The script (or web page) can continue after sending it to the server.

The server responds by sending the contents of a file or the output of a server side program (written, for example, in PHP).

When the response arrives from the server, a JavaScript function is triggered to act on the data supplied by the server.

This JavaScript response function typically refreshes the display using the DOM, avoiding the requirement to reload or refresh the entire page.

Page 8: AJAX

WE IMPLEMENTED The following example will demonstrate how a web page can

communicate with a web server while a user type characters in an input field:

Page 9: AJAX

1. HTML & CSS - User interface - Input from user - Display output - To style the data

3. JavaScript -creates an XMLHttpRequest object -initializes it -sends it to the server -interact with the information

2. PHP -saved on server -generate xml -send to clients computer -communication between JS and server -transferring data

Page 10: AJAX

HTML

Page 11: AJAX

PHP

Page 12: AJAX

JAVASCRIPT

Page 13: AJAX

THANK YOU