COMP-0020 Lecture Notes - Lecture 12: Json, Javascript, Xml

33 views2 pages

Document Summary

Syntax in javascript: [] for lists, {} for dictionaries developer. mbta. com/data/red. json provides data for where the red trains are in a giant dictionary. How to share data: in comp 11 we used . txt files, but what can go wrong with them? they"re annoying to parse because you have to read it line by line. Xml, but the problem is that they"re heavy. because there"s a lot of white space and more syntax-stuff than actual data content (old way of sharing data) So the solution to xml is json, which uses a collection of objects providing lightweight-ness. An object is an unordered set of key/value pairs. An object begins with { and ends with }. Each key is followed by a : and the key/value pairs are separated by , An array is an ordered collection of values. An array begins with [ and ends with ].

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents