Adsense
Popular Posts
- jQuery autocomplete scroll bar for dropdown menu
- JavaScript Arrays and Associate Arrays
- mod_auth_cas.so error: undefined symbol: SSL_connect
- Design date and signature box in Latex
- JavaScript, remove trailing insignificant zeros after toFixed function
- jQuery, toggle the display
- Difference between state and props in React
- Set Windows path command line
- Install APXS in Redhat Linux
- super(props) in React
Saturday, March 1, 2014
JSON: JavaScript Object Notation.
Similar to XML, JSON is used to store message in JavaScript. But JSON is smaller than XML and easy to parse.
JSON format:
a name followed by colon, followed by a value, such as
"fruit":"apple"
i.e fruit = "apple"
JSON object using curly bracket
var temp={"fruit":"apple", "juice":"orange"}
To access JSON object value:
temp.fruit, temp,juice
JSON array using square bracket:
var JSONarray= {
"food":[
{"fruit":"apple", "juice":"orange"},
{"fruit":"banana", "juice":"watermelon"}
]
}
To access the value fruit in array
JSONarray.food[0].fruit
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment