SlideShare uma empresa Scribd logo
1 de 11
JSON  Basics     Shyamala Prayaga
Agenda What is JSON? Why JSON? Pros and Cons JSON Syntax JSON Parser Accessing Data in JSON
What is JSON? Stands for JavaScript Object Notation Is lightweight format for exchanging data between the client and server. Easy for humans to read and write. Easy for machines to parse and generate    Often used in Ajax applications due to Its simplicity its format which is based on JavaScript object literals
Why JSON? JSON is recognized natively by JavaScript Simple format The easiness of reading  The easiness of using  Lighter than XML
Benefits over XML
Pros and Cons
JSON Syntax For objects start the object with “{“ and end it with “}”  For members (properties), use pairs of string : value and separate them by commas  For arrays put the arrays between []  For elements put the values directly separated by commas
Example  var myFirstJSON ={       "firstName" : "John",      "lastName" : "Doe",      "age"          : 23 };
JSON Parser You can convert JSON object into JSON text Object to Text Conversion     var myJSONText = myObject.toJSONString();
Accessing Data in JSON The most common way to access JSON data is through dot notation.    var myObject = { 'color' : 'blue' };document.writeln(myObject.color);
Questions?

Mais conteúdo relacionado

Mais procurados (20)

XML
XMLXML
XML
 
Ajax ppt
Ajax pptAjax ppt
Ajax ppt
 
JavaScript - Chapter 12 - Document Object Model
  JavaScript - Chapter 12 - Document Object Model  JavaScript - Chapter 12 - Document Object Model
JavaScript - Chapter 12 - Document Object Model
 
Json
JsonJson
Json
 
XML Schema
XML SchemaXML Schema
XML Schema
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
 
XML Introduction
XML IntroductionXML Introduction
XML Introduction
 
PHP Workshop Notes
PHP Workshop NotesPHP Workshop Notes
PHP Workshop Notes
 
An Overview of HTML, CSS & Java Script
An Overview of HTML, CSS & Java ScriptAn Overview of HTML, CSS & Java Script
An Overview of HTML, CSS & Java Script
 
Ajax
AjaxAjax
Ajax
 
Web api
Web apiWeb api
Web api
 
jQuery for beginners
jQuery for beginnersjQuery for beginners
jQuery for beginners
 
JavaScript Basics and Best Practices - CC FE & UX
JavaScript Basics and Best Practices - CC FE & UXJavaScript Basics and Best Practices - CC FE & UX
JavaScript Basics and Best Practices - CC FE & UX
 
Xml
XmlXml
Xml
 
What is Ajax technology?
What is Ajax technology?What is Ajax technology?
What is Ajax technology?
 
Php forms
Php formsPhp forms
Php forms
 
TypeScript Introduction
TypeScript IntroductionTypeScript Introduction
TypeScript Introduction
 
Java script
Java scriptJava script
Java script
 
Javascript built in String Functions
Javascript built in String FunctionsJavascript built in String Functions
Javascript built in String Functions
 
XML Schema
XML SchemaXML Schema
XML Schema
 

Semelhante a Json (20)

Json
JsonJson
Json
 
java script json
java script jsonjava script json
java script json
 
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
 
Java Script Object Notation (JSON)
Java Script Object Notation (JSON)Java Script Object Notation (JSON)
Java Script Object Notation (JSON)
 
Json tutorial, a beguiner guide
Json tutorial, a beguiner guideJson tutorial, a beguiner guide
Json tutorial, a beguiner guide
 
J s-o-n-120219575328402-3
J s-o-n-120219575328402-3J s-o-n-120219575328402-3
J s-o-n-120219575328402-3
 
json
jsonjson
json
 
Intro to JSON
Intro to JSONIntro to JSON
Intro to JSON
 
Json
JsonJson
Json
 
Json
JsonJson
Json
 
JSON.pptx
JSON.pptxJSON.pptx
JSON.pptx
 
JSON - (English)
JSON - (English)JSON - (English)
JSON - (English)
 
Json
JsonJson
Json
 
Web Development Course - AJAX & JSON by RSOLUTIONS
Web Development Course - AJAX & JSON by RSOLUTIONSWeb Development Course - AJAX & JSON by RSOLUTIONS
Web Development Course - AJAX & JSON by RSOLUTIONS
 
07 objective-c session 7
07  objective-c session 707  objective-c session 7
07 objective-c session 7
 
Json processing
Json processingJson processing
Json processing
 
Javascript2839
Javascript2839Javascript2839
Javascript2839
 
Json
JsonJson
Json
 
JSON-(JavaScript Object Notation)
JSON-(JavaScript Object Notation)JSON-(JavaScript Object Notation)
JSON-(JavaScript Object Notation)
 
Java Script Based Client Server Webapps 2
Java Script Based Client Server Webapps 2Java Script Based Client Server Webapps 2
Java Script Based Client Server Webapps 2
 

Mais de Shyamala Prayaga

Leveraging Augmented Reality Capability for enhancing the shopping experience
Leveraging Augmented Reality Capability for enhancing the shopping experienceLeveraging Augmented Reality Capability for enhancing the shopping experience
Leveraging Augmented Reality Capability for enhancing the shopping experienceShyamala Prayaga
 
My Interview with Healthy code Magazine: Future of Android Design
My Interview with Healthy code Magazine: Future of Android DesignMy Interview with Healthy code Magazine: Future of Android Design
My Interview with Healthy code Magazine: Future of Android DesignShyamala Prayaga
 
Interaction design workshop
Interaction design workshopInteraction design workshop
Interaction design workshopShyamala Prayaga
 
Mobile accessibility challenges and best practices v2
Mobile accessibility   challenges and best practices v2Mobile accessibility   challenges and best practices v2
Mobile accessibility challenges and best practices v2Shyamala Prayaga
 
MOBILE INTERACTION PATTERNS AND NON PATTERNS
MOBILE INTERACTION PATTERNS AND NON PATTERNSMOBILE INTERACTION PATTERNS AND NON PATTERNS
MOBILE INTERACTION PATTERNS AND NON PATTERNSShyamala Prayaga
 
Adobe Flex - Developing Rich Internet Application Workshop Day 2
Adobe Flex - Developing Rich Internet Application Workshop Day 2Adobe Flex - Developing Rich Internet Application Workshop Day 2
Adobe Flex - Developing Rich Internet Application Workshop Day 2Shyamala Prayaga
 
Adobe Flex - Developing Rich Internet Application Workshop Day 2
Adobe Flex - Developing Rich Internet Application Workshop Day 2Adobe Flex - Developing Rich Internet Application Workshop Day 2
Adobe Flex - Developing Rich Internet Application Workshop Day 2Shyamala Prayaga
 
Mobile UI and Usability Guidelines V1
Mobile UI and Usability Guidelines V1Mobile UI and Usability Guidelines V1
Mobile UI and Usability Guidelines V1Shyamala Prayaga
 
iPhone application development training day 1
iPhone application development training day 1iPhone application development training day 1
iPhone application development training day 1Shyamala Prayaga
 
Improving Site Performace Using Css Sprite
Improving Site Performace Using Css SpriteImproving Site Performace Using Css Sprite
Improving Site Performace Using Css SpriteShyamala Prayaga
 

Mais de Shyamala Prayaga (20)

HealthyCodeMay2014
HealthyCodeMay2014HealthyCodeMay2014
HealthyCodeMay2014
 
Leveraging Augmented Reality Capability for enhancing the shopping experience
Leveraging Augmented Reality Capability for enhancing the shopping experienceLeveraging Augmented Reality Capability for enhancing the shopping experience
Leveraging Augmented Reality Capability for enhancing the shopping experience
 
My Interview with Healthy code Magazine: Future of Android Design
My Interview with Healthy code Magazine: Future of Android DesignMy Interview with Healthy code Magazine: Future of Android Design
My Interview with Healthy code Magazine: Future of Android Design
 
Ticketing Application
Ticketing ApplicationTicketing Application
Ticketing Application
 
Interaction design workshop
Interaction design workshopInteraction design workshop
Interaction design workshop
 
Android design in action
Android design in actionAndroid design in action
Android design in action
 
Mobile accessibility challenges and best practices v2
Mobile accessibility   challenges and best practices v2Mobile accessibility   challenges and best practices v2
Mobile accessibility challenges and best practices v2
 
Mobile Prototyping
Mobile PrototypingMobile Prototyping
Mobile Prototyping
 
MOBILE INTERACTION PATTERNS AND NON PATTERNS
MOBILE INTERACTION PATTERNS AND NON PATTERNSMOBILE INTERACTION PATTERNS AND NON PATTERNS
MOBILE INTERACTION PATTERNS AND NON PATTERNS
 
Adobe Flex - Developing Rich Internet Application Workshop Day 2
Adobe Flex - Developing Rich Internet Application Workshop Day 2Adobe Flex - Developing Rich Internet Application Workshop Day 2
Adobe Flex - Developing Rich Internet Application Workshop Day 2
 
Adobe Flex - Developing Rich Internet Application Workshop Day 2
Adobe Flex - Developing Rich Internet Application Workshop Day 2Adobe Flex - Developing Rich Internet Application Workshop Day 2
Adobe Flex - Developing Rich Internet Application Workshop Day 2
 
Accessibility and ucd
Accessibility and ucdAccessibility and ucd
Accessibility and ucd
 
Android Design
Android DesignAndroid Design
Android Design
 
Mobile UI and Usability Guidelines V1
Mobile UI and Usability Guidelines V1Mobile UI and Usability Guidelines V1
Mobile UI and Usability Guidelines V1
 
Mobile Web Frameworks
Mobile Web FrameworksMobile Web Frameworks
Mobile Web Frameworks
 
iPhone application development training day 1
iPhone application development training day 1iPhone application development training day 1
iPhone application development training day 1
 
Usability Testing
Usability TestingUsability Testing
Usability Testing
 
Ethenographic research
Ethenographic researchEthenographic research
Ethenographic research
 
Improving Site Performace Using Css Sprite
Improving Site Performace Using Css SpriteImproving Site Performace Using Css Sprite
Improving Site Performace Using Css Sprite
 
Universal Design
Universal DesignUniversal Design
Universal Design
 

Json

  • 1. JSON Basics Shyamala Prayaga
  • 2. Agenda What is JSON? Why JSON? Pros and Cons JSON Syntax JSON Parser Accessing Data in JSON
  • 3. What is JSON? Stands for JavaScript Object Notation Is lightweight format for exchanging data between the client and server. Easy for humans to read and write. Easy for machines to parse and generate Often used in Ajax applications due to Its simplicity its format which is based on JavaScript object literals
  • 4. Why JSON? JSON is recognized natively by JavaScript Simple format The easiness of reading The easiness of using Lighter than XML
  • 7. JSON Syntax For objects start the object with “{“ and end it with “}” For members (properties), use pairs of string : value and separate them by commas For arrays put the arrays between [] For elements put the values directly separated by commas
  • 8. Example var myFirstJSON ={ "firstName" : "John",      "lastName" : "Doe",      "age"       : 23 };
  • 9. JSON Parser You can convert JSON object into JSON text Object to Text Conversion var myJSONText = myObject.toJSONString();
  • 10. Accessing Data in JSON The most common way to access JSON data is through dot notation. var myObject = { 'color' : 'blue' };document.writeln(myObject.color);