0% found this document useful (0 votes)
52 views22 pages

Chapter Six

Uploaded by

Estefen Ermias
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
52 views22 pages

Chapter Six

Uploaded by

Estefen Ermias
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 22

Compiled by Hadho D.

Chapter 6

Advanced JavaScript and XML


(AJAX)
Outline
2

 Introduction to AJAX
 XMLHttpRequest Object
 Sending Request to PHP server
 Handling Response from Server

Compiled by Hadho D.
What is AJAX?

AJAX = Asynchronous JavaScript And XML.


AJAX is not a programming language.
AJAX just uses a combination of:
 A browser built-in XMLHttpRequest object (to request data
from a web server)
 JavaScript and HTML DOM (to display or use the data)

Compiled by Hadho D.
4 Compiled by Hadho D.
Introduction to AJAX
5

 AJAX is a developer's dream, AJAX allows web pages to be


because you can:
updated asynchronously by
 Read data from a web
server- after the page has exchanging data with a web server
loaded behind the scenes.
 Update a web page without This means that it is possible to
reloading the page
update parts of a web page, without
 Send data to a web server- reloading the whole page.
in the background

Compiled by Hadho D.
How AJAX Works
6

Compiled by Hadho D.
Cont…
7

1. An event occurs in a web page (the page is loaded, a button is


clicked)
2. An XMLHttpRequest object is created by JavaScript
3. The XMLHttpRequest object sends a request to a web server
4. The server processes the request
5. The server sends a response back to the web page
6. The response is read by JavaScript
7. Proper action (like page update) is performed by JavaScript

Compiled by Hadho D.
8 Compiled by Hadho D.
9 Compiled by Hadho D.
10 Compiled by Hadho D.
11 Compiled by Hadho D.
STEPS TO IMPLEMENT AJAX

12 Compiled by Hadho D.
13 Compiled by Hadho D.
14 Compiled by Hadho D.
15 Compiled by Hadho D.
16 Compiled by Hadho D.
17 Compiled by Hadho D.
18 Compiled by Hadho D.
19 Compiled by Hadho D.
20 Compiled by Hadho D.
Create request

Make a request

To handle coming response

Send request

21 Compiled by Hadho D.
THE END OF CH-6
22

THANKYO
U!!
Compiled by Hadho D.

You might also like