SlideShare a Scribd company logo
JSON – Java Script Object
Notation
Written By:-Pankaj Srivastava
pankajshrivastav6@gmail.com
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.
 {
 "name": “Pankaj Kumar",
 "org": “India",
 }
 <?xml version='1.0‘ encoding='UTF-8'?>
 <element>
 <name>Pankaj Kumatr</name>
 <org>India</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

More Related Content

What's hot (20)

JSON - (English)
JSON - (English)JSON - (English)
JSON - (English)
Senior Dev
 
07 objective-c session 7
07  objective-c session 707  objective-c session 7
07 objective-c session 7
Amr Elghadban (AmrAngry)
 
Json
JsonJson
Json
mussawir20
 
Json processing
Json processingJson processing
Json processing
Ahmed Gamil
 
Json
JsonJson
Json
Raphael Wanjiku
 
An Introduction to JSON JavaScript Object Notation
An Introduction to JSON JavaScript Object NotationAn Introduction to JSON JavaScript Object Notation
An Introduction to JSON JavaScript Object Notation
Ahmed Muzammil
 
Basics of JSON (JavaScript Object Notation) with examples
Basics of JSON (JavaScript Object Notation) with examplesBasics of JSON (JavaScript Object Notation) with examples
Basics of JSON (JavaScript Object Notation) with examples
Sanjeev Kumar Jaiswal
 
Intro to JSON
Intro to JSONIntro to JSON
Intro to JSON
George McKinney
 
JSON(JavaScript Object Notation)
JSON(JavaScript Object Notation)JSON(JavaScript Object Notation)
JSON(JavaScript Object Notation)
Raghu nath
 
Quick overview on mongo db
Quick overview on mongo dbQuick overview on mongo db
Quick overview on mongo db
Eman Mohamed
 
Ajax
AjaxAjax
Ajax
Govardhan Bhavani
 
NoSQL - "simple" web monitoring
NoSQL - "simple" web monitoringNoSQL - "simple" web monitoring
NoSQL - "simple" web monitoring
Samir Siqueira
 
Json
JsonJson
Json
elliando dias
 
DOM-XML
DOM-XMLDOM-XML
DOM-XML
SaraswathiRamalingam
 
Unit 2.3
Unit 2.3Unit 2.3
Unit 2.3
Abhishek Kesharwani
 
Xml processing in scala
Xml processing in scalaXml processing in scala
Xml processing in scala
Knoldus Inc.
 
Xml processors
Xml processorsXml processors
Xml processors
Saurav Mawandia
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
S.Shayan Daneshvar
 
Overview on NoSQL and MongoDB
Overview on NoSQL and MongoDBOverview on NoSQL and MongoDB
Overview on NoSQL and MongoDB
harithakannan
 
Unit 2.3
Unit 2.3Unit 2.3
Unit 2.3
Abhishek Kesharwani
 

Similar to Json – java script object notation (20)

Json
Json Json
Json
Manav Prasad
 
Introduction to JavaScript Object Notation(JSON)
Introduction to JavaScript Object Notation(JSON)Introduction to JavaScript Object Notation(JSON)
Introduction to JavaScript Object Notation(JSON)
gaikwaddavid2022
 
JSON
JSONJSON
JSON
Zara Tariq
 
json.ppt download for free for college project
json.ppt download for free for college projectjson.ppt download for free for college project
json.ppt download for free for college project
AmitSharma397241
 
Json
JsonJson
Json
Anderson Oliveira
 
Unit-2.pptx
Unit-2.pptxUnit-2.pptx
Unit-2.pptx
AnujSood25
 
JSON & AJAX.pptx
JSON & AJAX.pptxJSON & AJAX.pptx
JSON & AJAX.pptx
dyumna2
 
Json
JsonJson
Json
krishnapriya Tadepalli
 
Json - ideal for data interchange
Json - ideal for data interchangeJson - ideal for data interchange
Json - ideal for data interchange
Christoph Santschi
 
Json
JsonJson
Json
Uma mohan
 
All about XML, JSON and related topics..
All about XML, JSON and related topics..All about XML, JSON and related topics..
All about XML, JSON and related topics..
tinumanueltmt
 
JSON Injection
JSON InjectionJSON Injection
JSON Injection
n|u - The Open Security Community
 
JSON Presentation.pptx JSON Presentation.pptx
JSON Presentation.pptx JSON Presentation.pptxJSON Presentation.pptx JSON Presentation.pptx
JSON Presentation.pptx JSON Presentation.pptx
trwdcn
 
Json
JsonJson
Json
soumya
 
Json
JsonJson
Json
Prabhat gangwar
 
JSON.pptx
JSON.pptxJSON.pptx
JSON.pptx
TilakaRt
 
J s o n
J s o nJ s o n
J s o n
nasifalnahian
 
Json
JsonJson
Json
Zainal Abdul Kahar
 
An introduction to json
An introduction to jsonAn introduction to json
An introduction to json
Naveenkumar5964
 
Intro to JSON
Intro to JSONIntro to JSON
Intro to JSON
Mark Daniel Dacer
 
Ad

Recently uploaded (20)

FIDO Seminar: Evolving Landscape of Post-Quantum Cryptography.pptx
FIDO Seminar: Evolving Landscape of Post-Quantum Cryptography.pptxFIDO Seminar: Evolving Landscape of Post-Quantum Cryptography.pptx
FIDO Seminar: Evolving Landscape of Post-Quantum Cryptography.pptx
FIDO Alliance
 
Agentic AI: Beyond the Buzz- LangGraph Studio V2
Agentic AI: Beyond the Buzz- LangGraph Studio V2Agentic AI: Beyond the Buzz- LangGraph Studio V2
Agentic AI: Beyond the Buzz- LangGraph Studio V2
Shashikant Jagtap
 
Crypto Super 500 - 14th Report - June2025.pdf
Crypto Super 500 - 14th Report - June2025.pdfCrypto Super 500 - 14th Report - June2025.pdf
Crypto Super 500 - 14th Report - June2025.pdf
Stephen Perrenod
 
FME for Good: Integrating Multiple Data Sources with APIs to Support Local Ch...
FME for Good: Integrating Multiple Data Sources with APIs to Support Local Ch...FME for Good: Integrating Multiple Data Sources with APIs to Support Local Ch...
FME for Good: Integrating Multiple Data Sources with APIs to Support Local Ch...
Safe Software
 
ENERGY CONSUMPTION CALCULATION IN ENERGY-EFFICIENT AIR CONDITIONER.pdf
ENERGY CONSUMPTION CALCULATION IN ENERGY-EFFICIENT AIR CONDITIONER.pdfENERGY CONSUMPTION CALCULATION IN ENERGY-EFFICIENT AIR CONDITIONER.pdf
ENERGY CONSUMPTION CALCULATION IN ENERGY-EFFICIENT AIR CONDITIONER.pdf
Muhammad Rizwan Akram
 
“Why It’s Critical to Have an Integrated Development Methodology for Edge AI,...
“Why It’s Critical to Have an Integrated Development Methodology for Edge AI,...“Why It’s Critical to Have an Integrated Development Methodology for Edge AI,...
“Why It’s Critical to Have an Integrated Development Methodology for Edge AI,...
Edge AI and Vision Alliance
 
Bridging the divide: A conversation on tariffs today in the book industry - T...
Bridging the divide: A conversation on tariffs today in the book industry - T...Bridging the divide: A conversation on tariffs today in the book industry - T...
Bridging the divide: A conversation on tariffs today in the book industry - T...
BookNet Canada
 
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
Safe Software
 
Enabling BIM / GIS integrations with Other Systems with FME
Enabling BIM / GIS integrations with Other Systems with FMEEnabling BIM / GIS integrations with Other Systems with FME
Enabling BIM / GIS integrations with Other Systems with FME
Safe Software
 
Edge-banding-machines-edgeteq-s-200-en-.pdf
Edge-banding-machines-edgeteq-s-200-en-.pdfEdge-banding-machines-edgeteq-s-200-en-.pdf
Edge-banding-machines-edgeteq-s-200-en-.pdf
AmirStern2
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 
vertical-cnc-processing-centers-drillteq-v-200-en.pdf
vertical-cnc-processing-centers-drillteq-v-200-en.pdfvertical-cnc-processing-centers-drillteq-v-200-en.pdf
vertical-cnc-processing-centers-drillteq-v-200-en.pdf
AmirStern2
 
Floods in Valencia: Two FME-Powered Stories of Data Resilience
Floods in Valencia: Two FME-Powered Stories of Data ResilienceFloods in Valencia: Two FME-Powered Stories of Data Resilience
Floods in Valencia: Two FME-Powered Stories of Data Resilience
Safe Software
 
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven InfrastructureNo-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
Safe Software
 
Analysis of the changes in the attitude of the news comments caused by knowin...
Analysis of the changes in the attitude of the news comments caused by knowin...Analysis of the changes in the attitude of the news comments caused by knowin...
Analysis of the changes in the attitude of the news comments caused by knowin...
Matsushita Laboratory
 
Mastering AI Workflows with FME - Peak of Data & AI 2025
Mastering AI Workflows with FME - Peak of Data & AI 2025Mastering AI Workflows with FME - Peak of Data & AI 2025
Mastering AI Workflows with FME - Peak of Data & AI 2025
Safe Software
 
Viral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Viral>Wondershare Filmora 14.5.18.12900 Crack Free DownloadViral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Viral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Puppy jhon
 
FME for Distribution & Transmission Integrity Management Program (DIMP & TIMP)
FME for Distribution & Transmission Integrity Management Program (DIMP & TIMP)FME for Distribution & Transmission Integrity Management Program (DIMP & TIMP)
FME for Distribution & Transmission Integrity Management Program (DIMP & TIMP)
Safe Software
 
Artificial Intelligence in the Nonprofit Boardroom.pdf
Artificial Intelligence in the Nonprofit Boardroom.pdfArtificial Intelligence in the Nonprofit Boardroom.pdf
Artificial Intelligence in the Nonprofit Boardroom.pdf
OnBoard
 
FIDO Seminar: Perspectives on Passkeys & Consumer Adoption.pptx
FIDO Seminar: Perspectives on Passkeys & Consumer Adoption.pptxFIDO Seminar: Perspectives on Passkeys & Consumer Adoption.pptx
FIDO Seminar: Perspectives on Passkeys & Consumer Adoption.pptx
FIDO Alliance
 
FIDO Seminar: Evolving Landscape of Post-Quantum Cryptography.pptx
FIDO Seminar: Evolving Landscape of Post-Quantum Cryptography.pptxFIDO Seminar: Evolving Landscape of Post-Quantum Cryptography.pptx
FIDO Seminar: Evolving Landscape of Post-Quantum Cryptography.pptx
FIDO Alliance
 
Agentic AI: Beyond the Buzz- LangGraph Studio V2
Agentic AI: Beyond the Buzz- LangGraph Studio V2Agentic AI: Beyond the Buzz- LangGraph Studio V2
Agentic AI: Beyond the Buzz- LangGraph Studio V2
Shashikant Jagtap
 
Crypto Super 500 - 14th Report - June2025.pdf
Crypto Super 500 - 14th Report - June2025.pdfCrypto Super 500 - 14th Report - June2025.pdf
Crypto Super 500 - 14th Report - June2025.pdf
Stephen Perrenod
 
FME for Good: Integrating Multiple Data Sources with APIs to Support Local Ch...
FME for Good: Integrating Multiple Data Sources with APIs to Support Local Ch...FME for Good: Integrating Multiple Data Sources with APIs to Support Local Ch...
FME for Good: Integrating Multiple Data Sources with APIs to Support Local Ch...
Safe Software
 
ENERGY CONSUMPTION CALCULATION IN ENERGY-EFFICIENT AIR CONDITIONER.pdf
ENERGY CONSUMPTION CALCULATION IN ENERGY-EFFICIENT AIR CONDITIONER.pdfENERGY CONSUMPTION CALCULATION IN ENERGY-EFFICIENT AIR CONDITIONER.pdf
ENERGY CONSUMPTION CALCULATION IN ENERGY-EFFICIENT AIR CONDITIONER.pdf
Muhammad Rizwan Akram
 
“Why It’s Critical to Have an Integrated Development Methodology for Edge AI,...
“Why It’s Critical to Have an Integrated Development Methodology for Edge AI,...“Why It’s Critical to Have an Integrated Development Methodology for Edge AI,...
“Why It’s Critical to Have an Integrated Development Methodology for Edge AI,...
Edge AI and Vision Alliance
 
Bridging the divide: A conversation on tariffs today in the book industry - T...
Bridging the divide: A conversation on tariffs today in the book industry - T...Bridging the divide: A conversation on tariffs today in the book industry - T...
Bridging the divide: A conversation on tariffs today in the book industry - T...
BookNet Canada
 
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
Safe Software
 
Enabling BIM / GIS integrations with Other Systems with FME
Enabling BIM / GIS integrations with Other Systems with FMEEnabling BIM / GIS integrations with Other Systems with FME
Enabling BIM / GIS integrations with Other Systems with FME
Safe Software
 
Edge-banding-machines-edgeteq-s-200-en-.pdf
Edge-banding-machines-edgeteq-s-200-en-.pdfEdge-banding-machines-edgeteq-s-200-en-.pdf
Edge-banding-machines-edgeteq-s-200-en-.pdf
AmirStern2
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 
vertical-cnc-processing-centers-drillteq-v-200-en.pdf
vertical-cnc-processing-centers-drillteq-v-200-en.pdfvertical-cnc-processing-centers-drillteq-v-200-en.pdf
vertical-cnc-processing-centers-drillteq-v-200-en.pdf
AmirStern2
 
Floods in Valencia: Two FME-Powered Stories of Data Resilience
Floods in Valencia: Two FME-Powered Stories of Data ResilienceFloods in Valencia: Two FME-Powered Stories of Data Resilience
Floods in Valencia: Two FME-Powered Stories of Data Resilience
Safe Software
 
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven InfrastructureNo-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
Safe Software
 
Analysis of the changes in the attitude of the news comments caused by knowin...
Analysis of the changes in the attitude of the news comments caused by knowin...Analysis of the changes in the attitude of the news comments caused by knowin...
Analysis of the changes in the attitude of the news comments caused by knowin...
Matsushita Laboratory
 
Mastering AI Workflows with FME - Peak of Data & AI 2025
Mastering AI Workflows with FME - Peak of Data & AI 2025Mastering AI Workflows with FME - Peak of Data & AI 2025
Mastering AI Workflows with FME - Peak of Data & AI 2025
Safe Software
 
Viral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Viral>Wondershare Filmora 14.5.18.12900 Crack Free DownloadViral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Viral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Puppy jhon
 
FME for Distribution & Transmission Integrity Management Program (DIMP & TIMP)
FME for Distribution & Transmission Integrity Management Program (DIMP & TIMP)FME for Distribution & Transmission Integrity Management Program (DIMP & TIMP)
FME for Distribution & Transmission Integrity Management Program (DIMP & TIMP)
Safe Software
 
Artificial Intelligence in the Nonprofit Boardroom.pdf
Artificial Intelligence in the Nonprofit Boardroom.pdfArtificial Intelligence in the Nonprofit Boardroom.pdf
Artificial Intelligence in the Nonprofit Boardroom.pdf
OnBoard
 
FIDO Seminar: Perspectives on Passkeys & Consumer Adoption.pptx
FIDO Seminar: Perspectives on Passkeys & Consumer Adoption.pptxFIDO Seminar: Perspectives on Passkeys & Consumer Adoption.pptx
FIDO Seminar: Perspectives on Passkeys & Consumer Adoption.pptx
FIDO Alliance
 
Ad

Json – java script object notation

  • 1. JSON – Java Script Object Notation Written By:-Pankaj Srivastava [email protected]
  • 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.  {  "name": “Pankaj Kumar",  "org": “India",  }  <?xml version='1.0‘ encoding='UTF-8'?>  <element>  <name>Pankaj Kumatr</name>  <org>India</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