Json
Upcoming SlideShare
Loading in...5
×
 

Json

on

  • 2,474 views

 

Statistics

Views

Total Views
2,474
Slideshare-icon Views on SlideShare
2,459
Embed Views
15

Actions

Likes
1
Downloads
0
Comments
0

2 Embeds 15

http://www.linkedin.com 11
http://www.slideshare.net 4

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Json Json Presentation Transcript

    • 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?