1 / 10

JSON

JSON. IDU0075 Sissejuhatus veebiteenustesse. What is JSON?. JSON stands for  J ava S cript  O bject  N otation JSON is lightweight text-data interchange format JSON is language independent  JSON is "self-describing" and easy to understand. Much Like XML. JSON is plain text

winola
Download Presentation

JSON

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. JSON IDU0075 Sissejuhatus veebiteenustesse

  2. What is JSON? JSON stands for JavaScript Object Notation JSON is lightweight text-data interchange format JSON is language independent  JSON is "self-describing" and easy to understand

  3. Much Like XML JSON is plain text JSON is "self-describing" (human readable) JSON is hierarchical (values within values) JSON can be parsed by JavaScript JSON data can be transported using AJAX

  4. Much Unlike XML No end tag Shorter Quicker to read and write Can be parsed using built-in JavaScript eval() Uses arrays No reserved words

  5. JSON Syntax Rules Data is in name/value pairs Data is separated by comma Curly brackets holds objects Square brackets holds arrays { "firstName":"John" , "lastName":"Doe" }

  6. JSON Syntax Rules {"employees": [{ "firstName":"John" , "lastName":"Doe" }, { "firstName":"Anna" , "lastName":"Smith" }, { "firstName":"Peter" , "lastName":"Jones" }]}

  7. JSON example { "firstName": „Peeter", "lastName": „Porgand", "address": { "streetAddress": „Ehitajate tee 5-III 301", "city": „Tallinn", "postalCode":„123456“ }, "phoneNumbers": [ "812 123-1234", "916 123-4567" ] }

  8. Samein XML <person> <firstName>Peeter</firstName><lastName>Porgand</lastName> <address> <streetAddress>Ehitajate tee</streetAddress><city>Tallinn</city><postalCode>123455</postalCode> </address> <phoneNumbers> <phoneNumber>812 123-1234</phoneNumber><phoneNumber>916 123-4567</phoneNumber></phoneNumbers> </person>

  9. JSON toJavaScript http://www.w3schools.com/json/tryit.asp?filename=tryjson_eval

  10. Aitäh! Julia Labunets 104234IABB51

More Related