SlideShare a Scribd company logo
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.
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

Active Server Page(ASP)
Active Server Page(ASP)Active Server Page(ASP)
Active Server Page(ASP)Keshab Nath
 
AJAX
AJAXAJAX
Ajax
AjaxAjax
Asp .net web form fundamentals
Asp .net web form fundamentalsAsp .net web form fundamentals
Asp .net web form fundamentalsGopal Ji Singh
 
Enterprise java unit-3_chapter-1-jsp
Enterprise  java unit-3_chapter-1-jspEnterprise  java unit-3_chapter-1-jsp
Enterprise java unit-3_chapter-1-jsp
sandeep54552
 
Enterprise java unit-1_chapter-2
Enterprise java unit-1_chapter-2Enterprise java unit-1_chapter-2
Enterprise java unit-1_chapter-2
sandeep54552
 
Asp.net web api
Asp.net web apiAsp.net web api
Asp.net web api
Binu Bhasuran
 
Application enumeration and launch
Application enumeration and launchApplication enumeration and launch
Application enumeration and launchPraveen Bakka
 
.net training | learn .net | Microsoft dot net Course | Microsoft dot net onl...
.net training | learn .net | Microsoft dot net Course | Microsoft dot net onl....net training | learn .net | Microsoft dot net Course | Microsoft dot net onl...
.net training | learn .net | Microsoft dot net Course | Microsoft dot net onl...
Nancy Thomas
 
Enterprise java unit-2_chapter-1
Enterprise  java unit-2_chapter-1Enterprise  java unit-2_chapter-1
Enterprise java unit-2_chapter-1
sandeep54552
 
Liftweb
LiftwebLiftweb
Liftweb
Scalac
 
ASP.NET Lecture 1
ASP.NET Lecture 1ASP.NET Lecture 1
ASP.NET Lecture 1
Julie Iskander
 
Asp dot net final (2)
Asp dot net   final (2)Asp dot net   final (2)
Asp dot net final (2)
Amelina Ahmeti
 
1. deploying an asp.net web application
1. deploying an asp.net web application1. deploying an asp.net web application
1. deploying an asp.net web application
Pramod Rathore
 
Angularjs & REST
Angularjs & RESTAngularjs & REST
Angularjs & REST
Corley S.r.l.
 
Introduction to React by Ebowe Blessing
Introduction to React by Ebowe BlessingIntroduction to React by Ebowe Blessing
Introduction to React by Ebowe Blessing
Blessing Ebowe
 
Anypoint connector basics
Anypoint connector basicsAnypoint connector basics
Anypoint connector basics
Ramakrishna kapa
 
Batch processing
Batch processingBatch processing
Batch processing
Ramakrishna kapa
 

What's hot (20)

Active Server Page(ASP)
Active Server Page(ASP)Active Server Page(ASP)
Active Server Page(ASP)
 
AJAX
AJAXAJAX
AJAX
 
Ajax
AjaxAjax
Ajax
 
Asp .net web form fundamentals
Asp .net web form fundamentalsAsp .net web form fundamentals
Asp .net web form fundamentals
 
Enterprise java unit-3_chapter-1-jsp
Enterprise  java unit-3_chapter-1-jspEnterprise  java unit-3_chapter-1-jsp
Enterprise java unit-3_chapter-1-jsp
 
Enterprise java unit-1_chapter-2
Enterprise java unit-1_chapter-2Enterprise java unit-1_chapter-2
Enterprise java unit-1_chapter-2
 
Ajax
AjaxAjax
Ajax
 
Asp.net web api
Asp.net web apiAsp.net web api
Asp.net web api
 
Application enumeration and launch
Application enumeration and launchApplication enumeration and launch
Application enumeration and launch
 
.net training | learn .net | Microsoft dot net Course | Microsoft dot net onl...
.net training | learn .net | Microsoft dot net Course | Microsoft dot net onl....net training | learn .net | Microsoft dot net Course | Microsoft dot net onl...
.net training | learn .net | Microsoft dot net Course | Microsoft dot net onl...
 
Enterprise java unit-2_chapter-1
Enterprise  java unit-2_chapter-1Enterprise  java unit-2_chapter-1
Enterprise java unit-2_chapter-1
 
Liftweb
LiftwebLiftweb
Liftweb
 
ASP.NET Lecture 1
ASP.NET Lecture 1ASP.NET Lecture 1
ASP.NET Lecture 1
 
Ajax
Ajax Ajax
Ajax
 
Asp dot net final (2)
Asp dot net   final (2)Asp dot net   final (2)
Asp dot net final (2)
 
1. deploying an asp.net web application
1. deploying an asp.net web application1. deploying an asp.net web application
1. deploying an asp.net web application
 
Angularjs & REST
Angularjs & RESTAngularjs & REST
Angularjs & REST
 
Introduction to React by Ebowe Blessing
Introduction to React by Ebowe BlessingIntroduction to React by Ebowe Blessing
Introduction to React by Ebowe Blessing
 
Anypoint connector basics
Anypoint connector basicsAnypoint connector basics
Anypoint connector basics
 
Batch processing
Batch processingBatch processing
Batch processing
 

Similar to Ajax enabled rich internet applications with xml and json

25250716 seminar-on-ajax text
25250716 seminar-on-ajax text25250716 seminar-on-ajax text
25250716 seminar-on-ajax text
Kamleshh Chandnani
 
Ajax tutorial by bally chohan
Ajax tutorial by bally chohanAjax tutorial by bally chohan
Ajax tutorial by bally chohan
WebVineet
 
jQuery Ajax
jQuery AjaxjQuery Ajax
jQuery Ajax
Anand Kumar Rajana
 
AJAX
AJAXAJAX
AJAXARJUN
 
SynapseIndia dotnet development ajax client library
SynapseIndia dotnet development ajax client librarySynapseIndia dotnet development ajax client library
SynapseIndia dotnet development ajax client library
Synapseindiappsdevelopment
 
WEB TECHNOLOGY Unit-5.pptx
WEB TECHNOLOGY Unit-5.pptxWEB TECHNOLOGY Unit-5.pptx
WEB TECHNOLOGY Unit-5.pptx
karthiksmart21
 
Introduction to ajax
Introduction to ajaxIntroduction to ajax
Introduction to ajax
Raja V
 
Ajax
AjaxAjax
Asynchronous JavaScript & XML (AJAX)
Asynchronous JavaScript & XML (AJAX)Asynchronous JavaScript & XML (AJAX)
Asynchronous JavaScript & XML (AJAX)
Adnan Sohail
 
Ajax.pdf
Ajax.pdfAjax.pdf
Unit-5.pptx
Unit-5.pptxUnit-5.pptx
Unit-5.pptx
itzkuu01
 

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

Ajax
AjaxAjax
Ajax
 
Ajax.ppt
Ajax.pptAjax.ppt
Ajax.ppt
 
Ajax
AjaxAjax
Ajax
 
25250716 seminar-on-ajax text
25250716 seminar-on-ajax text25250716 seminar-on-ajax text
25250716 seminar-on-ajax text
 
Ajax tutorial by bally chohan
Ajax tutorial by bally chohanAjax tutorial by bally chohan
Ajax tutorial by bally chohan
 
Ajax Ppt 1
Ajax Ppt 1Ajax Ppt 1
Ajax Ppt 1
 
Mashup
MashupMashup
Mashup
 
jQuery Ajax
jQuery AjaxjQuery Ajax
jQuery Ajax
 
Ajax
AjaxAjax
Ajax
 
AJAX
AJAXAJAX
AJAX
 
Ajax
AjaxAjax
Ajax
 
SynapseIndia dotnet development ajax client library
SynapseIndia dotnet development ajax client librarySynapseIndia dotnet development ajax client library
SynapseIndia dotnet development ajax client library
 
Ajax
AjaxAjax
Ajax
 
WEB TECHNOLOGY Unit-5.pptx
WEB TECHNOLOGY Unit-5.pptxWEB TECHNOLOGY Unit-5.pptx
WEB TECHNOLOGY Unit-5.pptx
 
Introduction to ajax
Introduction to ajaxIntroduction to ajax
Introduction to ajax
 
Ajax
AjaxAjax
Ajax
 
Asynchronous JavaScript & XML (AJAX)
Asynchronous JavaScript & XML (AJAX)Asynchronous JavaScript & XML (AJAX)
Asynchronous JavaScript & XML (AJAX)
 
Ajax.pdf
Ajax.pdfAjax.pdf
Ajax.pdf
 
Unit-5.pptx
Unit-5.pptxUnit-5.pptx
Unit-5.pptx
 
Ajax
AjaxAjax
Ajax
 

More from ArchanaMani2

Software evolution and Verification,validation
Software evolution and Verification,validationSoftware evolution and Verification,validation
Software evolution and Verification,validation
ArchanaMani2
 
Code scheduling constraints
Code scheduling constraintsCode scheduling constraints
Code scheduling constraints
ArchanaMani2
 
Excellence in visulization
Excellence in visulizationExcellence in visulization
Excellence in visulization
ArchanaMani2
 
Firewall
FirewallFirewall
Firewall
ArchanaMani2
 
The linux system
The linux systemThe linux system
The linux system
ArchanaMani2
 
Big data
Big dataBig data
Big data
ArchanaMani2
 
Transaction management
Transaction managementTransaction management
Transaction management
ArchanaMani2
 
Topological Sort and BFS
Topological Sort and BFSTopological Sort and BFS
Topological Sort and BFS
ArchanaMani2
 
Genetic algorithm
Genetic algorithmGenetic algorithm
Genetic algorithm
ArchanaMani2
 
Inheritance and overriding
Inheritance  and overridingInheritance  and overriding
Inheritance and overriding
ArchanaMani2
 

More from ArchanaMani2 (10)

Software evolution and Verification,validation
Software evolution and Verification,validationSoftware evolution and Verification,validation
Software evolution and Verification,validation
 
Code scheduling constraints
Code scheduling constraintsCode scheduling constraints
Code scheduling constraints
 
Excellence in visulization
Excellence in visulizationExcellence in visulization
Excellence in visulization
 
Firewall
FirewallFirewall
Firewall
 
The linux system
The linux systemThe linux system
The linux system
 
Big data
Big dataBig data
Big data
 
Transaction management
Transaction managementTransaction management
Transaction management
 
Topological Sort and BFS
Topological Sort and BFSTopological Sort and BFS
Topological Sort and BFS
 
Genetic algorithm
Genetic algorithmGenetic algorithm
Genetic algorithm
 
Inheritance and overriding
Inheritance  and overridingInheritance  and overriding
Inheritance and overriding
 

Recently uploaded

CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
BhavyaRajput3
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
Peter Windle
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 
678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf
CarlosHernanMontoyab2
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
Jheel Barad
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
Nguyen Thanh Tu Collection
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Po-Chuan Chen
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 

Recently uploaded (20)

CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 

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.
  • 12.
  • 13.
  • 14.
  • 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