SlideShare a Scribd company logo
2
Most read
7
Most read
9
Most read
ARCHANA.M
II-MSC(CS)
DEPARTMENT OF CS & IT
NADAR SARASWATHI COLLEGE OF
ARTS AND SCIENCE
 Usability of web applications has lagged behind that of desktop applications
 Rich Internet Applications (RIAs)
-Web applications that approximate the look, feel and usability of desktop
applications
-Two key attributes—performance and rich GUI
 RIA performance
-Comes from Ajax (Asynchronous JavaScript and XML), which uses client-side
scripting to make web applications more responsive
Ajax applications separate client-side user interaction and server
communication, and run them in parallel, making the delays of server-
side processing more transparent to the user
“Raw” Ajax:
-uses JavaScript to send asynchronous requests to the server,
then updates the page using the DOM
-need to deal directly with cross-browser portability issues,
making it impractical for developing large-scale applications
Portability issues
-Hidden by Ajax toolkits, such as jQuery, ASP.NET Ajax and JSF’s Ajax
capabilities, which provide powerful ready-to-use controls and functions that
enrich web applications and simplify JavaScript coding by making it cross-
browser compatible.
Achieve rich GUI in RIAs with
-JavaScript toolkits, providing powerful ready-to-use controls and
functions that enrich web applications.
 Traditional web applications
-User fills in the form’s fields, then submits the form
-Browser generates a request to the server, which receives the request and processes it
-Server generates and sends a response containing the exact page that the browser will
render
-Browser loads the new page and temporarily makes the browser window blank
-Client waits for the server to respond and reloads the entire page with the data from the
response
In an Ajax application, when the user interacts with a page
-Client creates an XMLHttpRequest object to manage a request
-XMLHttpRequest object sends the request to and awaits the response
from the server
-Requests are asynchronous, allowing the user to continue interacting with
the application while the server processes the request concurrently
-When the server responds, the XMLHttpRequest object that issued the
request invokes a callback function, which typically uses partial page updates to
display the returned data in the existing web page without reloading the entire
page
 Classic HTML registration form
-Sends all of the data to be validated to the server when the user clicks the
Register button
-While the server is validating the data, the user cannot interact with the page
-Server finds invalid data, generates a new page identifying the errors in the
form and sends it back to the client—which renders the page in the browser
-User fixes the errors and clicks the Register button again
-Cycle repeats until no errors are found, then the data is stored on the server
-Entire page reloads every time the user submits invalid data
 Ajax-enabled forms are more interactive
-Entries are validated individually, dynamically as the user enters data into the
fields
-If a problem is found, the server sends an error message that is asynchronously
displayed to inform the user of the problem
-Sending each entry asynchronously allows the user to address invalid entries
quickly, rather than making edits and resubmitting the entire form repeatedly until all
entries are valid
-Asynchronous requests could also be used to fill some fields based on previous
fields’ values (e.g., city based on zip code)
 XMLHttpRequest object
-Resides on the client
-Is the layer between the client and the server that manages asynchronous
requests in Ajax applications
-Supported on most browsers, though they may implement it differently
 To initiate an asynchronous request
-Create an instance of the XMLHttpRequest object
-Use its open method to set up the request, and its send method to initiate the
request
When an Ajax application requests a file from a server, the browser
typically caches that file
-Subsequent requests for the same file can load it from the browser’s
cache
When the third argument to XMLHttpRequest method open is true, the
request is asynchronous
The following figures summarize some of the XMLHttpRequest object’s
properties and methods, respectively.
The properties are crucial to interacting with asynchronous requests.
The methods initialize, configure and send asynchronous requests.
Ajax enabled rich internet applications with xml and json
Ajax enabled rich internet applications with xml and json
Ajax enabled rich internet applications with xml and json
The web application may interacts with a web service to obtain data and
to modify data in a server-side database.
The web application and server communicate with a data format called
JSON (JavaScript Object Notation).
The application executes server-side functions (or APIs) that occurs in
parallel with the user interacting with the web application.
JSON (JavaScript Object Notation)
-Simple way to represent JavaScript objects as strings
-A simpler alternative to XML for passing data between the client
and the server
-API in many programming languages
JSON object
-Represented as a list of property names and values contained in
curly braces
-{ "propertyName1" : value1, "propertyName2": value2 }
Array
-Represented in JSON with square brackets containing a comma-
separated list of values
-Each value in a JSON array can be a string, a number, a JSON
representation of an object, true, false or null
-"array_name“: [ { "propertyName1" : value1, "propertyName2":
value2 }, { "propertyName1" : value1, "propertyName2": value2 } ]
JSON strings
-Easier to create and parse than XML
-Require fewer bytes
-For these reasons, JSON is commonly used to
communicate in client/server interaction
Web service’s functions or APIs may returns a JSON
representation of an object or array of objects.
For example, when the web application requests the list of
names in the address book, the list is returned as a JSON array.
Address-book data formatted in JSON:
[ { "first": "Cheryl", "last": "Black" },
{ "first": "James", "last": "Blue" },
{ "first": "Mike", "last": "Brown" },
{ "first": "Meg", "last": "Gold" } ]
When the XMLHttpRequest object receives the response, it calls the
JSON.parse function, which converts the JSON string into a JavaScript
object
Ajax enabled rich internet applications with xml and json

More Related Content

What's hot (20)

PPTX
Honeypots
Rushikesh Kulkarni
 
PDF
Bonnes pratiques anti-DDOS
Julien SIMON
 
PPT
Cloud Security
Rashmi Agale
 
PPTX
Android Intent.pptx
vishal choudhary
 
PPTX
Android Services
Ahsanul Karim
 
PPTX
High-Level Display: Screen J2ME User Interface
suman sinkhwal
 
PPTX
Code injection
Gayatri Patel
 
PDF
Introduction to flutter
Wan Muzaffar Wan Hashim
 
PPTX
Honeypot
Sushan Sharma
 
PPTX
Metasploit
henelpj
 
PDF
Android resources
ma-polimi
 
PPTX
Virtual machine
IGZ Software house
 
PDF
Cloud service lifecycle management
Animesh Chaturvedi
 
PPTX
Client server chat application
Samsil Arefin
 
PPTX
android sqlite
Deepa Rani
 
PDF
Git cheat sheet
Birtan Yıldız
 
PPTX
Send Sms with SmsManager Api In Android with Kotlin
ShahRushika
 
PDF
RAT - Repurposing Adversarial Tradecraft
⭕Alexander Rymdeko-Harvey
 
PDF
Think Like a Hacker - Database Attack Vectors
Mark Ginnebaugh
 
PPTX
Web application security part 01
Prachi Gulihar
 
Bonnes pratiques anti-DDOS
Julien SIMON
 
Cloud Security
Rashmi Agale
 
Android Intent.pptx
vishal choudhary
 
Android Services
Ahsanul Karim
 
High-Level Display: Screen J2ME User Interface
suman sinkhwal
 
Code injection
Gayatri Patel
 
Introduction to flutter
Wan Muzaffar Wan Hashim
 
Honeypot
Sushan Sharma
 
Metasploit
henelpj
 
Android resources
ma-polimi
 
Virtual machine
IGZ Software house
 
Cloud service lifecycle management
Animesh Chaturvedi
 
Client server chat application
Samsil Arefin
 
android sqlite
Deepa Rani
 
Git cheat sheet
Birtan Yıldız
 
Send Sms with SmsManager Api In Android with Kotlin
ShahRushika
 
RAT - Repurposing Adversarial Tradecraft
⭕Alexander Rymdeko-Harvey
 
Think Like a Hacker - Database Attack Vectors
Mark Ginnebaugh
 
Web application security part 01
Prachi Gulihar
 

Similar to Ajax enabled rich internet applications with xml and json (20)

PPT
Ajax
TSUBHASHRI
 
TXT
25250716 seminar-on-ajax text
Kamleshh Chandnani
 
PPT
Ajax tutorial by bally chohan
WebVineet
 
PPT
Ajax Ppt 1
JayaPrakash.m
 
PPT
Mashup
Naveen P.N
 
PPT
jQuery Ajax
Anand Kumar Rajana
 
PPT
AJAX
ARJUN
 
PPT
Ajax
rahmed_sct
 
PPT
SynapseIndia dotnet development ajax client library
Synapseindiappsdevelopment
 
PPTX
WEB TECHNOLOGY Unit-5.pptx
karthiksmart21
 
PPTX
Introduction to ajax
Raja V
 
PPT
Ajax
guest873a50
 
PPT
Asynchronous JavaScript & XML (AJAX)
Adnan Sohail
 
PDF
Ajax.pdf
Rajkiran Mummadi
 
PPTX
Unit-5.pptx
itzkuu01
 
25250716 seminar-on-ajax text
Kamleshh Chandnani
 
Ajax tutorial by bally chohan
WebVineet
 
Ajax Ppt 1
JayaPrakash.m
 
Mashup
Naveen P.N
 
jQuery Ajax
Anand Kumar Rajana
 
AJAX
ARJUN
 
SynapseIndia dotnet development ajax client library
Synapseindiappsdevelopment
 
WEB TECHNOLOGY Unit-5.pptx
karthiksmart21
 
Introduction to ajax
Raja V
 
Asynchronous JavaScript & XML (AJAX)
Adnan Sohail
 
Unit-5.pptx
itzkuu01
 
Ad

More from ArchanaMani2 (10)

PPTX
Software evolution and Verification,validation
ArchanaMani2
 
PPTX
Code scheduling constraints
ArchanaMani2
 
PPTX
Excellence in visulization
ArchanaMani2
 
PPTX
Firewall
ArchanaMani2
 
PPTX
The linux system
ArchanaMani2
 
PPTX
Big data
ArchanaMani2
 
PPTX
Transaction management
ArchanaMani2
 
PPTX
Topological Sort and BFS
ArchanaMani2
 
PPTX
Genetic algorithm
ArchanaMani2
 
PPTX
Inheritance and overriding
ArchanaMani2
 
Software evolution and Verification,validation
ArchanaMani2
 
Code scheduling constraints
ArchanaMani2
 
Excellence in visulization
ArchanaMani2
 
Firewall
ArchanaMani2
 
The linux system
ArchanaMani2
 
Big data
ArchanaMani2
 
Transaction management
ArchanaMani2
 
Topological Sort and BFS
ArchanaMani2
 
Genetic algorithm
ArchanaMani2
 
Inheritance and overriding
ArchanaMani2
 
Ad

Recently uploaded (20)

PPTX
grade 5 lesson matatag ENGLISH 5_Q1_PPT_WEEK4.pptx
SireQuinn
 
PDF
CONCURSO DE POESIA “POETUFAS – PASSOS SUAVES PELO VERSO.pdf
Colégio Santa Teresinha
 
PDF
Biological Bilingual Glossary Hindi and English Medium
World of Wisdom
 
PDF
Chapter-V-DED-Entrepreneurship: Institutions Facilitating Entrepreneurship
Dayanand Huded
 
PDF
Aprendendo Arquitetura Framework Salesforce - Dia 03
Mauricio Alexandre Silva
 
PPTX
PATIENT ASSIGNMENTS AND NURSING CARE RESPONSIBILITIES.pptx
PRADEEP ABOTHU
 
PDF
DIGESTION OF CARBOHYDRATES,PROTEINS,LIPIDS
raviralanaresh2
 
PDF
Geographical Diversity of India 100 Mcq.pdf/ 7th class new ncert /Social/Samy...
Sandeep Swamy
 
PPT
Talk on Critical Theory, Part One, Philosophy of Social Sciences
Soraj Hongladarom
 
PPTX
I AM MALALA The Girl Who Stood Up for Education and was Shot by the Taliban...
Beena E S
 
PPTX
QUARTER 1 WEEK 2 PLOT, POV AND CONFLICTS
KynaParas
 
PPTX
How to Convert an Opportunity into a Quotation in Odoo 18 CRM
Celine George
 
PPTX
HUMAN RESOURCE MANAGEMENT: RECRUITMENT, SELECTION, PLACEMENT, DEPLOYMENT, TRA...
PRADEEP ABOTHU
 
PDF
0725.WHITEPAPER-UNIQUEWAYSOFPROTOTYPINGANDUXNOW.pdf
Thomas GIRARD, MA, CDP
 
PPTX
Universal immunization Programme (UIP).pptx
Vishal Chanalia
 
PPTX
How to Manage Large Scrollbar in Odoo 18 POS
Celine George
 
PPTX
CATEGORIES OF NURSING PERSONNEL: HOSPITAL & COLLEGE
PRADEEP ABOTHU
 
PPTX
Cultivation practice of Litchi in Nepal.pptx
UmeshTimilsina1
 
PDF
Knee Extensor Mechanism Injuries - Orthopedic Radiologic Imaging
Sean M. Fox
 
PPTX
Growth and development and milestones, factors
BHUVANESHWARI BADIGER
 
grade 5 lesson matatag ENGLISH 5_Q1_PPT_WEEK4.pptx
SireQuinn
 
CONCURSO DE POESIA “POETUFAS – PASSOS SUAVES PELO VERSO.pdf
Colégio Santa Teresinha
 
Biological Bilingual Glossary Hindi and English Medium
World of Wisdom
 
Chapter-V-DED-Entrepreneurship: Institutions Facilitating Entrepreneurship
Dayanand Huded
 
Aprendendo Arquitetura Framework Salesforce - Dia 03
Mauricio Alexandre Silva
 
PATIENT ASSIGNMENTS AND NURSING CARE RESPONSIBILITIES.pptx
PRADEEP ABOTHU
 
DIGESTION OF CARBOHYDRATES,PROTEINS,LIPIDS
raviralanaresh2
 
Geographical Diversity of India 100 Mcq.pdf/ 7th class new ncert /Social/Samy...
Sandeep Swamy
 
Talk on Critical Theory, Part One, Philosophy of Social Sciences
Soraj Hongladarom
 
I AM MALALA The Girl Who Stood Up for Education and was Shot by the Taliban...
Beena E S
 
QUARTER 1 WEEK 2 PLOT, POV AND CONFLICTS
KynaParas
 
How to Convert an Opportunity into a Quotation in Odoo 18 CRM
Celine George
 
HUMAN RESOURCE MANAGEMENT: RECRUITMENT, SELECTION, PLACEMENT, DEPLOYMENT, TRA...
PRADEEP ABOTHU
 
0725.WHITEPAPER-UNIQUEWAYSOFPROTOTYPINGANDUXNOW.pdf
Thomas GIRARD, MA, CDP
 
Universal immunization Programme (UIP).pptx
Vishal Chanalia
 
How to Manage Large Scrollbar in Odoo 18 POS
Celine George
 
CATEGORIES OF NURSING PERSONNEL: HOSPITAL & COLLEGE
PRADEEP ABOTHU
 
Cultivation practice of Litchi in Nepal.pptx
UmeshTimilsina1
 
Knee Extensor Mechanism Injuries - Orthopedic Radiologic Imaging
Sean M. Fox
 
Growth and development and milestones, factors
BHUVANESHWARI BADIGER
 

Ajax enabled rich internet applications with xml and json

  • 1. ARCHANA.M II-MSC(CS) DEPARTMENT OF CS & IT NADAR SARASWATHI COLLEGE OF ARTS AND SCIENCE
  • 2.  Usability of web applications has lagged behind that of desktop applications  Rich Internet Applications (RIAs) -Web applications that approximate the look, feel and usability of desktop applications -Two key attributes—performance and rich GUI  RIA performance -Comes from Ajax (Asynchronous JavaScript and XML), which uses client-side scripting to make web applications more responsive
  • 3. Ajax applications separate client-side user interaction and server communication, and run them in parallel, making the delays of server- side processing more transparent to the user “Raw” Ajax: -uses JavaScript to send asynchronous requests to the server, then updates the page using the DOM -need to deal directly with cross-browser portability issues, making it impractical for developing large-scale applications
  • 4. Portability issues -Hidden by Ajax toolkits, such as jQuery, ASP.NET Ajax and JSF’s Ajax capabilities, which provide powerful ready-to-use controls and functions that enrich web applications and simplify JavaScript coding by making it cross- browser compatible. Achieve rich GUI in RIAs with -JavaScript toolkits, providing powerful ready-to-use controls and functions that enrich web applications.
  • 5.  Traditional web applications -User fills in the form’s fields, then submits the form -Browser generates a request to the server, which receives the request and processes it -Server generates and sends a response containing the exact page that the browser will render -Browser loads the new page and temporarily makes the browser window blank -Client waits for the server to respond and reloads the entire page with the data from the response
  • 6. In an Ajax application, when the user interacts with a page -Client creates an XMLHttpRequest object to manage a request -XMLHttpRequest object sends the request to and awaits the response from the server -Requests are asynchronous, allowing the user to continue interacting with the application while the server processes the request concurrently -When the server responds, the XMLHttpRequest object that issued the request invokes a callback function, which typically uses partial page updates to display the returned data in the existing web page without reloading the entire page
  • 7.  Classic HTML registration form -Sends all of the data to be validated to the server when the user clicks the Register button -While the server is validating the data, the user cannot interact with the page -Server finds invalid data, generates a new page identifying the errors in the form and sends it back to the client—which renders the page in the browser -User fixes the errors and clicks the Register button again -Cycle repeats until no errors are found, then the data is stored on the server -Entire page reloads every time the user submits invalid data
  • 8.  Ajax-enabled forms are more interactive -Entries are validated individually, dynamically as the user enters data into the fields -If a problem is found, the server sends an error message that is asynchronously displayed to inform the user of the problem -Sending each entry asynchronously allows the user to address invalid entries quickly, rather than making edits and resubmitting the entire form repeatedly until all entries are valid -Asynchronous requests could also be used to fill some fields based on previous fields’ values (e.g., city based on zip code)
  • 9.  XMLHttpRequest object -Resides on the client -Is the layer between the client and the server that manages asynchronous requests in Ajax applications -Supported on most browsers, though they may implement it differently  To initiate an asynchronous request -Create an instance of the XMLHttpRequest object -Use its open method to set up the request, and its send method to initiate the request
  • 10. When an Ajax application requests a file from a server, the browser typically caches that file -Subsequent requests for the same file can load it from the browser’s cache When the third argument to XMLHttpRequest method open is true, the request is asynchronous
  • 11. The following figures summarize some of the XMLHttpRequest object’s properties and methods, respectively. The properties are crucial to interacting with asynchronous requests. The methods initialize, configure and send asynchronous requests.
  • 15. The web application may interacts with a web service to obtain data and to modify data in a server-side database. The web application and server communicate with a data format called JSON (JavaScript Object Notation). The application executes server-side functions (or APIs) that occurs in parallel with the user interacting with the web application.
  • 16. JSON (JavaScript Object Notation) -Simple way to represent JavaScript objects as strings -A simpler alternative to XML for passing data between the client and the server -API in many programming languages JSON object -Represented as a list of property names and values contained in curly braces -{ "propertyName1" : value1, "propertyName2": value2 }
  • 17. Array -Represented in JSON with square brackets containing a comma- separated list of values -Each value in a JSON array can be a string, a number, a JSON representation of an object, true, false or null -"array_name“: [ { "propertyName1" : value1, "propertyName2": value2 }, { "propertyName1" : value1, "propertyName2": value2 } ]
  • 18. JSON strings -Easier to create and parse than XML -Require fewer bytes -For these reasons, JSON is commonly used to communicate in client/server interaction
  • 19. Web service’s functions or APIs may returns a JSON representation of an object or array of objects. For example, when the web application requests the list of names in the address book, the list is returned as a JSON array.
  • 20. Address-book data formatted in JSON: [ { "first": "Cheryl", "last": "Black" }, { "first": "James", "last": "Blue" }, { "first": "Mike", "last": "Brown" }, { "first": "Meg", "last": "Gold" } ] When the XMLHttpRequest object receives the response, it calls the JSON.parse function, which converts the JSON string into a JavaScript object