Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
JSON  Basics    <br />Shyamala Prayaga<br />
Agenda<br />What is JSON?<br />Why JSON?<br />Pros and Cons<br />JSON Syntax<br />JSON Parser<br />Accessing Data in JSON<...
What is JSON?<br />Stands for JavaScript Object Notation<br />Is lightweight format for exchanging data between the client...
Why JSON?<br />JSON is recognized natively by JavaScript<br />Simple format<br />The easiness of reading <br />The easines...
Benefits over XML<br />
Pros and Cons<br />
JSON Syntax<br />For objects start the object with “{“ and end it with “}” <br />For members (properties), use pairs of st...
Example <br />var myFirstJSON ={       &quot;firstName&quot; : &quot;John&quot;,      &quot;lastName&quot; : &quot;Doe&quo...
JSON Parser<br />You can convert JSON object into JSON text<br />Object to Text Conversion <br />   var myJSONText = myObj...
Accessing Data in JSON<br />The most common way to access JSON data is through dot notation. <br />  var myObject = { &apo...
Questions?<br />
Upcoming SlideShare
Loading in …5
×

Json

4,167 views

Published on

  • Be the first to comment

Json

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

×