Json data format

Creative Commons License Copyright: Attribution, allow others to create paper-based, and must distribute paper (based on the original license agreement with the same license Creative Commons )

Json data format is roughly divided into four categories:

The first way is equivalent to java :( kind of map (key, value))

var json={
 key:value,
 key:value,
 key:value
};

must be a string key, value can be any data type value

The second way is equivalent to java :( kind of List <Object>)

var json=[
            {key:value,key:value},
            {key:value,key:value}
         ];

The third way is equivalent to java :( species Map <String, List <Person >>)

var json=[
    {
        key:value,
        key:value
    },
    {
        key:value,
        key:value
    }
]

The fourth way :( equivalent of java Map <String, List <Object >>)

var json={
     "param":[
                {key:value,key:value},
                {key:value,key:value}
            ],
     "param1":[
                {key:value,key:value},
                {key:value,key:value}
            ]
 }

 

 

Guess you like

Origin blog.csdn.net/longyanchen/article/details/93383099