Summarize the usage of json by yourself:
Copy codeThe Code is as follows:
Var json = {"100_3322.JPG": {"name": "Xiaozhang", "height": 175 },
"100_3396.JPG": {"name": "John", "height": 165 },
"100_3444.JPG": {"name": "mink Chan", "height": 185}, "100_3543.JPG": {"name": "Xi Shi", "height": 190}
};
The key obtains 100--3322.JPG and so on.
Key. name obtains Xiaozhang and so on.
Key. height obtains 175 and so on.
========================================================== ==========
Copy codeThe Code is as follows:
Var json = [{"name": "baidu", "href": "http://www.baidu.com" },{ "name": "cnbeta", "href": "http://www.cnbeta.com "}, {"name": "cnblogs", "href": "http://www.cnblogs.com"}];
It can be used during traversal.
Json [I]. href
Json [I]. name get the name of each link
========================================================== ==========
Copy codeThe Code is as follows:
Var json = {"Hebei Province": ["Shijiazhuang", "Handan", "Baoding"],
"Henan Province": ["Zhengzhou", "Luoyang", "Anyang"],
"Shandong Province": ["Jinan", "Qingdao", "Dezhou"]
}
Key acquisition in Hebei Province
Json [key] Get the array content below Hebei Province ["Shijiazhuang", "Handan", "Baoding"]