您的位置:首页 > Web前端 > JavaScript

Json学习笔记

2015-06-07 00:03 816 查看

JSON —> JavaScript Object Notation, 一种轻量级的数据交换格式。

一、JSON的形式:

              1)对象Object。无序的“名称/值对集合”。{name1:value1, name2:name2, key3:name3}

                name为string。



[align=left] [/align]

              2)数组Array。值的有序集合。[value1, value2,value3]    



[align=left] [/align]

 

二、值 value

       双引号括起来的字符串string、数值number、true、false、null、对象object或者数组array。允许嵌套。

三、JSON文本是一系列遵循JSON value语法的Unicode符号。

      JSON符号包括6种结构符号、strings、numbers和3中名称符号。

      结构性符号(6种):[  {  ]  }  :  ,

      文本名称符号(3种):true  false  null

四、JSON只有一种数字形式,即number,这样便于不同编程语言间数据交换。

       JSON is agnostic about numbers. In any programming language, there can be a variety of number types of various capacities and complements, fixed or floating, binary or decimal. That can make interchange between different programming languages difficult.
JSON instead offers only the representation of numbers that humans use: a sequence of digits. All programming languages know how to make sense of digit sequences even if they disagree on internal representation. That is enough to allow interchange.

 

参考资料: 1、JSON官网介绍 http://www.json.org/json-zh.html
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: