SlideShare a Scribd company logo
JSON – Java Script Object
Notation
Dilip Kumar Gupta
What is JSON
 JSON is a data interchange format
 Interactive Web 2.0 applications, no more
use page replacement. Data transfer without
refreshing a page.
 The most important aspects of data transfer
are simplicity, extensibility, interoperability,
openness and human readability
 Key idea in AJAX – Asynchronous Java
Script and XML.
Topics to cover
 Overview of the working of JSON
 Properties of JSON as a data format
 JSON with AJAX
 Advantages of using JSON with AJAX
 Security Concerns in using JSON
 Where does it fit the best
How does it work?
 JSON is a subset of Java Script. JSON can
be parsed by a Java Script parser.
 It can represent either complex or simple
data as it has data types
 They are Strings, Number, Boolean, Objects
and Arrays
 E.g. of Object:
 { "name": "Jack ("Bee") Nimble", "format":
{ "type": "rect", "width": 120, "interlace":
false}}
 An array can be shown as
 ["Sunday", "Monday", "Tuesday",
"Wednesday“]
 All data types are intuitive and similar to other
programming languages
 Also compatible with other languages like C,
C++, C#, ColdFusion, Python and many
more.
Properties of JSON
 It's simultaneously human- and machine-readable
format.
 It has support for Unicode, allowing almost any
information in any human language to be communicated;
 The self-documenting format that describes structure
and field names as well as specific values.
 The strict syntax and parsing requirements that allow the
necessary parsing algorithms to remain simple, efficient,
and consistent;
 The ability to represent the most general computer
science data structures: records, lists and trees.
JSON in AJAX
 JSON can be used in AJAX as follows:
 Include it in HTML directly
 <html>... <script> var data = JSONdata;
</script>... </html>
 JSON is used with XMLHttpRequest and can
be converted into a JavaScript structure
 responseData = eval('(' + responseText + ')');
 Another approach is to use an invisible
<iframe> for data communication. The server
sends JSON text embedded in a script in a
document.
 <html><head><script> document.domain =
‘something.com’; parent.deliver(JSONtext);
</script></head></html>
 deliver is passed the incoming data structure.
Why is JSON better suited for AJAX?
 JSON is widely used in AJAX. The X in AJAX stands for XML.
 E.g.
 {
 "fullname": "Swati Kumar",
 "org": "Columbia",
 }
 <?xml version='1.0‘ encoding='UTF-8'?>
 <element>
 <fullname>Swati Kumar</fullname>
 <org>Columbia</org>
 </element>
 JSON response at client side is:
 var name = eval('(' + req.responseText +
')').fullname.value;
 To access a composite element
 eval('(' + req.responseText +
')').xyz.abc.value;
 Thus, any level deep elements can be easily
accessed.
 XML response at client side is:
 var root = req.responseXML;
 var name =
root.getElementsByTagName(‘fullname’);
 To access a composite element
 root.getElementsByTagName(‘xyz’)
[0].firstChild
 To access deeper levels we need more
overhead.
 Reduced extensibility in XML
Security Concerns
 Same Origin Policy - JavaScript to access the
contents of a Webpage, both the JavaScript
and the Web page must originate from the
same domain.
 Malicious website could serve up JavaScript
that loads sensitive information from other
websites using a client's credentials and
communicates it back to the attacker.
 Although the malicious JavaScript can’t
directly manipulate the contents, it can view
the execution of the JavaScript and store the
results it returns.
 This problem gets aggravated with JSON as
the JSON arrays are themselves JavaScript
objects and any malicious user can view
them directly.
Where can JSON be used?
 JSON is a light weight data format that can
be used for transferring medium amounts of
data.
 It can be used in Java Script and then
rendered on HTML pages
 AJAX has many applications for JSON
 Thus, use JSON for applications that are
browser based.
References:
 www.json.org
 RFC 4627, Network Working Group D.
Crockford
 Thank you
Ad

Recommended

Json – java script object notation
Json – java script object notation
Pankaj Srivastava
 
Json
Json
Anand Kumar Rajana
 
Json
Json
Shyamala Prayaga
 
JSON
JSON
yogendra singh chahar
 
java script json
java script json
chauhankapil
 
Java Script Object Notation (JSON)
Java Script Object Notation (JSON)
Adnan Sohail
 
Introduction to JSON
Introduction to JSON
Kanda Runapongsa Saikaew
 
Json
Json
baabtra.com - No. 1 supplier of quality freshers
 
07 objective-c session 7
07 objective-c session 7
Amr Elghadban (AmrAngry)
 
Overview on NoSQL and MongoDB
Overview on NoSQL and MongoDB
harithakannan
 
Quick overview on mongo db
Quick overview on mongo db
Eman Mohamed
 
Json
Json
Raphael Wanjiku
 
Json
Json
mussawir20
 
Json processing
Json processing
Ahmed Gamil
 
Basics of JSON (JavaScript Object Notation) with examples
Basics of JSON (JavaScript Object Notation) with examples
Sanjeev Kumar Jaiswal
 
Intro to JSON
Intro to JSON
George McKinney
 
NoSQL - "simple" web monitoring
NoSQL - "simple" web monitoring
Samir Siqueira
 
Unit 2.3
Unit 2.3
Abhishek Kesharwani
 
Json
Json
elliando dias
 
An Introduction to JSON JavaScript Object Notation
An Introduction to JSON JavaScript Object Notation
Ahmed Muzammil
 
Cordova training : Day 4 - Advanced Javascript
Cordova training : Day 4 - Advanced Javascript
Binu Paul
 
Unit 2.3
Unit 2.3
Abhishek Kesharwani
 
Xml processing in scala
Xml processing in scala
Knoldus Inc.
 
Mongo db – document oriented database
Mongo db – document oriented database
Wojciech Sznapka
 
Xml processors
Xml processors
Saurav Mawandia
 
JSON(JavaScript Object Notation)
JSON(JavaScript Object Notation)
Raghu nath
 
Ajax
Ajax
Govardhan Bhavani
 
NoSQL Endgame DevoxxUA Conference 2020
NoSQL Endgame DevoxxUA Conference 2020
Thodoris Bais
 
Json
Json
Manav Prasad
 
Introduction to JavaScript Object Notation(JSON)
Introduction to JavaScript Object Notation(JSON)
gaikwaddavid2022
 

More Related Content

What's hot (20)

07 objective-c session 7
07 objective-c session 7
Amr Elghadban (AmrAngry)
 
Overview on NoSQL and MongoDB
Overview on NoSQL and MongoDB
harithakannan
 
Quick overview on mongo db
Quick overview on mongo db
Eman Mohamed
 
Json
Json
Raphael Wanjiku
 
Json
Json
mussawir20
 
Json processing
Json processing
Ahmed Gamil
 
Basics of JSON (JavaScript Object Notation) with examples
Basics of JSON (JavaScript Object Notation) with examples
Sanjeev Kumar Jaiswal
 
Intro to JSON
Intro to JSON
George McKinney
 
NoSQL - "simple" web monitoring
NoSQL - "simple" web monitoring
Samir Siqueira
 
Unit 2.3
Unit 2.3
Abhishek Kesharwani
 
Json
Json
elliando dias
 
An Introduction to JSON JavaScript Object Notation
An Introduction to JSON JavaScript Object Notation
Ahmed Muzammil
 
Cordova training : Day 4 - Advanced Javascript
Cordova training : Day 4 - Advanced Javascript
Binu Paul
 
Unit 2.3
Unit 2.3
Abhishek Kesharwani
 
Xml processing in scala
Xml processing in scala
Knoldus Inc.
 
Mongo db – document oriented database
Mongo db – document oriented database
Wojciech Sznapka
 
Xml processors
Xml processors
Saurav Mawandia
 
JSON(JavaScript Object Notation)
JSON(JavaScript Object Notation)
Raghu nath
 
Ajax
Ajax
Govardhan Bhavani
 
NoSQL Endgame DevoxxUA Conference 2020
NoSQL Endgame DevoxxUA Conference 2020
Thodoris Bais
 
Overview on NoSQL and MongoDB
Overview on NoSQL and MongoDB
harithakannan
 
Quick overview on mongo db
Quick overview on mongo db
Eman Mohamed
 
Basics of JSON (JavaScript Object Notation) with examples
Basics of JSON (JavaScript Object Notation) with examples
Sanjeev Kumar Jaiswal
 
NoSQL - "simple" web monitoring
NoSQL - "simple" web monitoring
Samir Siqueira
 
An Introduction to JSON JavaScript Object Notation
An Introduction to JSON JavaScript Object Notation
Ahmed Muzammil
 
Cordova training : Day 4 - Advanced Javascript
Cordova training : Day 4 - Advanced Javascript
Binu Paul
 
Xml processing in scala
Xml processing in scala
Knoldus Inc.
 
Mongo db – document oriented database
Mongo db – document oriented database
Wojciech Sznapka
 
JSON(JavaScript Object Notation)
JSON(JavaScript Object Notation)
Raghu nath
 
NoSQL Endgame DevoxxUA Conference 2020
NoSQL Endgame DevoxxUA Conference 2020
Thodoris Bais
 

Similar to Json – java script object notation (20)

Json
Json
Manav Prasad
 
Introduction to JavaScript Object Notation(JSON)
Introduction to JavaScript Object Notation(JSON)
gaikwaddavid2022
 
JSON & AJAX.pptx
JSON & AJAX.pptx
dyumna2
 
json.ppt download for free for college project
json.ppt download for free for college project
AmitSharma397241
 
JSON
JSON
Zara Tariq
 
JSON - (English)
JSON - (English)
Senior Dev
 
Json
Json
krishnapriya Tadepalli
 
Unit-2.pptx
Unit-2.pptx
AnujSood25
 
All about XML, JSON and related topics..
All about XML, JSON and related topics..
tinumanueltmt
 
Json
Json
Prabhat gangwar
 
Json - ideal for data interchange
Json - ideal for data interchange
Christoph Santschi
 
Json
Json
Anderson Oliveira
 
Json
Json
soumya
 
JSON Injection
JSON Injection
n|u - The Open Security Community
 
Json
Json
primeteacher32
 
Web Development Course - AJAX & JSON by RSOLUTIONS
Web Development Course - AJAX & JSON by RSOLUTIONS
RSolutions
 
JSON
JSON
Ibrahim AlIbrahim
 
Intro to JSON
Intro to JSON
Mark Daniel Dacer
 
J s o n
J s o n
nasifalnahian
 
Json
Json
Zainal Abdul Kahar
 
Ad

Recently uploaded (20)

MATERI PPT TOPIK 1 LANDASAN FILOSOFIS PENDIDIKAN
MATERI PPT TOPIK 1 LANDASAN FILOSOFIS PENDIDIKAN
aditya23173
 
What are the benefits that dance brings?
What are the benefits that dance brings?
memi27
 
june 10 2025 ppt for madden on art science is over.pptx
june 10 2025 ppt for madden on art science is over.pptx
roger malina
 
The Man In The Back – Exceptional Delaware.pdf
The Man In The Back – Exceptional Delaware.pdf
dennisongomezk
 
Sustainable Innovation with Immersive Learning
Sustainable Innovation with Immersive Learning
Leonel Morgado
 
How to Manage Upselling of Subscriptions in Odoo 18
How to Manage Upselling of Subscriptions in Odoo 18
Celine George
 
Analysis of Quantitative Data Parametric and non-parametric tests.pptx
Analysis of Quantitative Data Parametric and non-parametric tests.pptx
Shrutidhara2
 
Rai dyansty Chach or Brahamn dynasty, History of Dahir History of Sindh NEP.pptx
Rai dyansty Chach or Brahamn dynasty, History of Dahir History of Sindh NEP.pptx
Dr. Ravi Shankar Arya Mahila P. G. College, Banaras Hindu University, Varanasi, India.
 
IDF 30min presentation - December 2, 2024.pptx
IDF 30min presentation - December 2, 2024.pptx
ArneeAgligar
 
How to Manage Inventory Movement in Odoo 18 POS
How to Manage Inventory Movement in Odoo 18 POS
Celine George
 
How to Manage Multi Language for Invoice in Odoo 18
How to Manage Multi Language for Invoice in Odoo 18
Celine George
 
ROLE PLAY: FIRST AID -CPR & RECOVERY POSITION.pptx
ROLE PLAY: FIRST AID -CPR & RECOVERY POSITION.pptx
Belicia R.S
 
BUSINESS QUIZ PRELIMS | QUIZ CLUB OF PSGCAS | 9 SEPTEMBER 2024
BUSINESS QUIZ PRELIMS | QUIZ CLUB OF PSGCAS | 9 SEPTEMBER 2024
Quiz Club of PSG College of Arts & Science
 
SPENT QUIZ NQL JR FEST 5.0 BY SOURAV.pptx
SPENT QUIZ NQL JR FEST 5.0 BY SOURAV.pptx
Sourav Kr Podder
 
GEOGRAPHY-Study Material [ Class 10th] .pdf
GEOGRAPHY-Study Material [ Class 10th] .pdf
SHERAZ AHMAD LONE
 
Webcrawler_Mule_AIChain_MuleSoft_Meetup_Hyderabad
Webcrawler_Mule_AIChain_MuleSoft_Meetup_Hyderabad
Veera Pallapu
 
Exploring Ocean Floor Features for Middle School
Exploring Ocean Floor Features for Middle School
Marie
 
Nice Dream.pdf /
Nice Dream.pdf /
ErinUsher3
 
How to Manage & Create a New Department in Odoo 18 Employee
How to Manage & Create a New Department in Odoo 18 Employee
Celine George
 
FEBA Sofia Univercity final diplian v3 GSDG 5.2025.pdf
FEBA Sofia Univercity final diplian v3 GSDG 5.2025.pdf
ChristinaFortunova
 
MATERI PPT TOPIK 1 LANDASAN FILOSOFIS PENDIDIKAN
MATERI PPT TOPIK 1 LANDASAN FILOSOFIS PENDIDIKAN
aditya23173
 
What are the benefits that dance brings?
What are the benefits that dance brings?
memi27
 
june 10 2025 ppt for madden on art science is over.pptx
june 10 2025 ppt for madden on art science is over.pptx
roger malina
 
The Man In The Back – Exceptional Delaware.pdf
The Man In The Back – Exceptional Delaware.pdf
dennisongomezk
 
Sustainable Innovation with Immersive Learning
Sustainable Innovation with Immersive Learning
Leonel Morgado
 
How to Manage Upselling of Subscriptions in Odoo 18
How to Manage Upselling of Subscriptions in Odoo 18
Celine George
 
Analysis of Quantitative Data Parametric and non-parametric tests.pptx
Analysis of Quantitative Data Parametric and non-parametric tests.pptx
Shrutidhara2
 
IDF 30min presentation - December 2, 2024.pptx
IDF 30min presentation - December 2, 2024.pptx
ArneeAgligar
 
How to Manage Inventory Movement in Odoo 18 POS
How to Manage Inventory Movement in Odoo 18 POS
Celine George
 
How to Manage Multi Language for Invoice in Odoo 18
How to Manage Multi Language for Invoice in Odoo 18
Celine George
 
ROLE PLAY: FIRST AID -CPR & RECOVERY POSITION.pptx
ROLE PLAY: FIRST AID -CPR & RECOVERY POSITION.pptx
Belicia R.S
 
SPENT QUIZ NQL JR FEST 5.0 BY SOURAV.pptx
SPENT QUIZ NQL JR FEST 5.0 BY SOURAV.pptx
Sourav Kr Podder
 
GEOGRAPHY-Study Material [ Class 10th] .pdf
GEOGRAPHY-Study Material [ Class 10th] .pdf
SHERAZ AHMAD LONE
 
Webcrawler_Mule_AIChain_MuleSoft_Meetup_Hyderabad
Webcrawler_Mule_AIChain_MuleSoft_Meetup_Hyderabad
Veera Pallapu
 
Exploring Ocean Floor Features for Middle School
Exploring Ocean Floor Features for Middle School
Marie
 
Nice Dream.pdf /
Nice Dream.pdf /
ErinUsher3
 
How to Manage & Create a New Department in Odoo 18 Employee
How to Manage & Create a New Department in Odoo 18 Employee
Celine George
 
FEBA Sofia Univercity final diplian v3 GSDG 5.2025.pdf
FEBA Sofia Univercity final diplian v3 GSDG 5.2025.pdf
ChristinaFortunova
 
Ad

Json – java script object notation

  • 1. JSON – Java Script Object Notation Dilip Kumar Gupta
  • 2. What is JSON  JSON is a data interchange format  Interactive Web 2.0 applications, no more use page replacement. Data transfer without refreshing a page.  The most important aspects of data transfer are simplicity, extensibility, interoperability, openness and human readability  Key idea in AJAX – Asynchronous Java Script and XML.
  • 3. Topics to cover  Overview of the working of JSON  Properties of JSON as a data format  JSON with AJAX  Advantages of using JSON with AJAX  Security Concerns in using JSON  Where does it fit the best
  • 4. How does it work?  JSON is a subset of Java Script. JSON can be parsed by a Java Script parser.  It can represent either complex or simple data as it has data types  They are Strings, Number, Boolean, Objects and Arrays  E.g. of Object:  { "name": "Jack ("Bee") Nimble", "format": { "type": "rect", "width": 120, "interlace": false}}
  • 5.  An array can be shown as  ["Sunday", "Monday", "Tuesday", "Wednesday“]  All data types are intuitive and similar to other programming languages  Also compatible with other languages like C, C++, C#, ColdFusion, Python and many more.
  • 6. Properties of JSON  It's simultaneously human- and machine-readable format.  It has support for Unicode, allowing almost any information in any human language to be communicated;  The self-documenting format that describes structure and field names as well as specific values.  The strict syntax and parsing requirements that allow the necessary parsing algorithms to remain simple, efficient, and consistent;  The ability to represent the most general computer science data structures: records, lists and trees.
  • 7. JSON in AJAX  JSON can be used in AJAX as follows:  Include it in HTML directly  <html>... <script> var data = JSONdata; </script>... </html>  JSON is used with XMLHttpRequest and can be converted into a JavaScript structure  responseData = eval('(' + responseText + ')');
  • 8.  Another approach is to use an invisible <iframe> for data communication. The server sends JSON text embedded in a script in a document.  <html><head><script> document.domain = ‘something.com’; parent.deliver(JSONtext); </script></head></html>  deliver is passed the incoming data structure.
  • 9. Why is JSON better suited for AJAX?  JSON is widely used in AJAX. The X in AJAX stands for XML.  E.g.  {  "fullname": "Swati Kumar",  "org": "Columbia",  }  <?xml version='1.0‘ encoding='UTF-8'?>  <element>  <fullname>Swati Kumar</fullname>  <org>Columbia</org>  </element>
  • 10.  JSON response at client side is:  var name = eval('(' + req.responseText + ')').fullname.value;  To access a composite element  eval('(' + req.responseText + ')').xyz.abc.value;  Thus, any level deep elements can be easily accessed.
  • 11.  XML response at client side is:  var root = req.responseXML;  var name = root.getElementsByTagName(‘fullname’);  To access a composite element  root.getElementsByTagName(‘xyz’) [0].firstChild  To access deeper levels we need more overhead.  Reduced extensibility in XML
  • 12. Security Concerns  Same Origin Policy - JavaScript to access the contents of a Webpage, both the JavaScript and the Web page must originate from the same domain.  Malicious website could serve up JavaScript that loads sensitive information from other websites using a client's credentials and communicates it back to the attacker.
  • 13.  Although the malicious JavaScript can’t directly manipulate the contents, it can view the execution of the JavaScript and store the results it returns.  This problem gets aggravated with JSON as the JSON arrays are themselves JavaScript objects and any malicious user can view them directly.
  • 14. Where can JSON be used?  JSON is a light weight data format that can be used for transferring medium amounts of data.  It can be used in Java Script and then rendered on HTML pages  AJAX has many applications for JSON  Thus, use JSON for applications that are browser based.
  • 15. References:  www.json.org  RFC 4627, Network Working Group D. Crockford  Thank you