JSON supports following values:
number (integer or floating point)
string
boolean
array
object
null
Here is the example for creating JSON object :
var JsonObj={JSON attributes is accessed by using '.' (dot) Operator easily.
'langName' : "javascript",
'notation' : "JSON",
'price': 500,
'date': "28 July 2013",
'easy' : "true"
};
So if we want to access langName attribute, we can access like this:
JsonObj.langName here JsonObj (JSON object name) and langName is object attribute.
output: javascript
Similarly for price attribute:
JsonObj.price
output: 500
Check running example here:
http://jsfiddle.net/jeetu_verma11/A7t2m/9/
0 comments:
Post a Comment