17
AJAX-Web Development Technology BY-Amit Mishra 20/03/22 Amit Mishra 1

Ajax

Embed Size (px)

Citation preview

Saturday 15 April 2023 Amit Mishra 1

AJAX-Web Development Technology

BY-Amit Mishra

Saturday 15 April 2023 Amit Mishra 2

Outline

• What is AJAX?• Why to use AJAX?• Who is using AJAX?• How AJAX works?• Technolgy used in AJAX• XML HttpRequest Methods• AJAX security• Advantages of AJAX• Limitation of AJAX

Saturday 15 April 2023 Amit Mishra 3

What is AJAX?

• AJAX is Asynchronous JavaScript and XML.• AJAX is a new technique for creating dynamic

interactive web applications with the help of XML, HTML, CSS and Java Script.

• With AJAX 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.

Saturday 15 April 2023 Amit Mishra 4

• Examples of applications using AJAX: Google Maps,Yahoo Maps, Gmail, Youtube, and Facebook tabs.

• AJAX applications are browser- and platform-independent.

• Ajax is a client-side script that communicates to and from a server/database

Saturday 15 April 2023 Amit Mishra 5

Why to use AJAX?

• To cut the response time.• It is updating data in background.• Asynchronous Interaction.

Saturday 15 April 2023 Amit Mishra 6

Who is using AJAX?

Saturday 15 April 2023 Amit Mishra 7

Who is using AJAX?

Saturday 15 April 2023 Amit Mishra 8

How AJAX works?

Saturday 15 April 2023 Amit Mishra 9

• To get data on the server, XMLHttpRequest provides two methods:

• open: create a connection.• send: send a request to the server.• Data furnished by the server will be found in the attributes

of the XMLHttpRequest object:• responseXml for an XML file or• responseText for a plain text.• We have to wait for the data to be available to process it,

and in this purpose, the state of availability of data is given by the readyState attribute of XMLHttpRequest.

Saturday 15 April 2023 Amit Mishra 10

Technology used in AJAX

• JavaScript• It is scripting language.• JavaScript functions is called when an event in a

page occurs.• Glue for the whole AJAX operation.• DOM• API for accessing and manipulating documents.• Represents the format of XML and HTML

documents

Saturday 15 April 2023 Amit Mishra 11

• CSS• Allows for a clear separation of the

presentation style from the content and may be changed programmatically by JavaScript

• XMLHttpRequest• JavaScript object that performs asynchrous

interaction with the server

Saturday 15 April 2023 Amit Mishra 12

AjAX security

• Ajax Security : Server Side• AJAX-based Web applications use the same server

side security schemes of regular Web applications• We can specify authentication, authorization, and

data protection requirements in your web.xml file (declarative) or in your program (programatic)

• AJAX-based Web applications are subject to the same security threats as regular Web applications

Saturday 15 April 2023 Amit Mishra 13

• Ajax Security : Client Side• JavaScript code is visible to a user/hacker. Hacker

can use the JavaScript code for inferring server side weaknesses

• JavaScript code is downloaded from the server and executed ("eval") at the client and can compromise the client by mal-intended code.

• Downloaded JavaScript code is constrained by sand-box security model and can be relaxed for signed JavaScript

Saturday 15 April 2023 Amit Mishra 14

XML HttpRequest Methods

• abort()Cancels the current request.

• getAllResponseHeaders()Returns the complete set of HTTP headers as a string.

• getResponseHeader( headerName )Returns the value of the specified HTTP header.

• send( content )Sends the request.

• setRequestHeader( label, value )Adds a label/value pair to the HTTP header to be sent.

Saturday 15 April 2023 Amit Mishra 15

Advantages

• It comes with all modern browsers.• Response time is faster.• It reduce the time between client and server.• AJAX communicates over HTTP protocol.

Saturday 15 April 2023 Amit Mishra 16

Disadvantages

• It can increase design and development time.• More complex than building classic web application• Security is less in AJAX application as all files are

downloaded at client side.• Search Engine like Google cannot index AJAX pages.• JavaScript disabled browsers cannot use the application.• Due to security limitation, we can only use it to access

information from the host that served the initial page.

Saturday 15 April 2023 Amit Mishra 17

Thank You For Your Attention