全称 JavaScript Object Notation(JavaScript 对象表示法),是存储和交换文本信息的语法。
语法
举例:
{
“sites”: [
{ “name”:”菜鸟教程” , “url”:”www.runoob.com” },
{ “name”:”google” , “url”:”www.google.com” },
{ “name”:”微博” , “url”:”www.weibo.com” }
]
}
var data = [
{“month”:1,”value”:151.5686572},
{“month”:2,”value”:269.6876241},
{“month”:3,”value”:963.2683131},
{“month”:4,”value”:873.4874557},
{“month”:5,”value”:297.7056036},
{“month”:6,”value”:696.048782},
{“month”:7,”value”:-835.6416219},
{“month”:8,”value”:-265.6451654},
{“month”:9,”value”:-732.8789312},
{“month”:10,”value”:407.8833173},
{“month”:11,”value”:993.0998599},
{“month”:12,”value”:581.2282138}
];
- 大括号保存对象
- 中括号保存数组
- 数据由逗号分隔