2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

JSON简单介绍

Posted at

1.简介

  • JSON: JavaScript Object Notation(JavaScript 对象表示法)
  • JSON 是存储和交换文本信息的语法。类似 XML。
  • JSON 比 XML 更小、更快,更易解析。

2.语法

JSON 语法是 JavaScript 对象表示语法的子集。

  • 数据在名称/值对中
  • 数据由逗号分隔
  • 大括号保存对象:{}
  • 中括号保存数组:[]

3.值

  • 数字(整数或浮点数)
  • 字符串(在双引号中)
  • 逻辑值(true 或 false)
  • 数组(在中括号中)
  • 对象(在大括号中)
  • null

4.例

{
  "sites": [
    {
      "name": “AA","url": "www.runoob.com","age": 30,"flag": true,"runoob": null
    },
    {
      "name": “BB","url": "www.google.com","age": 20,"flag": false,"runoob": null
    },
    {
      "name": “CC","url": "www.weibo.com","age": 10,"flag": true,"runoob": null
    }
  ]
}

5.工具

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?