Download presentation
Presentation is loading. Please wait.
Published byGrant Goodman Modified over 9 years ago
1
JSON IDU0075 Sissejuhatus veebiteenustesse
2
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 What is JSON?
3
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 Much Like XML
4
No end tag Shorter Quicker to read and write Can be parsed using built-in JavaScript eval() Uses arrays No reserved words Much Unlike XML
5
Data is in name/value pairs Data is separated by comma Curly brackets holds objects Square brackets holds arrays { "firstName":"John", "lastName":"Doe" } JSON Syntax Rules
6
{ "employees": [ { "firstName":"John", "lastName":"Doe" }, { "firstName":"Anna", "lastName":"Smith" }, { "firstName":"Peter", "lastName":"Jones" } ] } JSON Syntax Rules
7
{ "firstName": „Peeter", "lastName": „Porgand", "address": { "streetAddress": „Ehitajate tee 5-III 301", "city": „Tallinn", "postalCode": „123456“ }, "phoneNumbers": [ "812 123-1234", "916 123-4567" ] } JSON example
8
Peeter Porgand Ehitajate tee Tallinn 123455 812 123-1234 916 123-4567 Same in XML
9
http://www.w3schools.com/json/tryit.asp?filename=tr yjson_eval http://www.w3schools.com/json/tryit.asp?filename=tr yjson_eval JSON to JavaScript
10
Aitäh! Julia Labunets 104234IABB51
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.