Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/xpath/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 创建具有3个属性的json文件_Javascript_Json - Fatal编程技术网

Javascript 创建具有3个属性的json文件

Javascript 创建具有3个属性的json文件,javascript,json,Javascript,Json,我想创建一个json文件,在is键上有3个属性,每个键都有两个字段,目前我尝试了以下内容,但我发现了一个错误,这里遗漏了什么 { "test1": { "id": "0001", "type": "USER" }"Test2": { "id": "0002", "type": "USER2" } } 分隔test1数组和test2数组的逗号 { "test1": { "id": "

我想创建一个json文件,在is键上有3个属性,每个键都有两个字段,目前我尝试了以下内容,但我发现了一个错误,这里遗漏了什么

{
    "test1": {
        "id": "0001",
        "type": "USER"
    }"Test2": {
        "id": "0002",
        "type": "USER2"
    }
} 

分隔test1数组和test2数组的逗号

{
    "test1": {
        "id": "0001",
        "type": "USER"
    },
    "test2": {
        "id": "0002",
        "type": "USER2"
    }
} 

分隔test1数组和test2数组的逗号

{
    "test1": {
        "id": "0001",
        "type": "USER"
    },
    "test2": {
        "id": "0002",
        "type": "USER2"
    }
} 

分隔test1数组和test2数组的逗号

{
    "test1": {
        "id": "0001",
        "type": "USER"
    },
    "test2": {
        "id": "0002",
        "type": "USER2"
    }
} 

分隔test1数组和test2数组的逗号

{
    "test1": {
        "id": "0001",
        "type": "USER"
    },
    "test2": {
        "id": "0002",
        "type": "USER2"
    }
} 

一般来说没关系,您只需要添加一个逗号

{
"test1": {
    "id": "0001",
    "type": "USER"
}
, // comma here is important
"Test2": {
    "id": "0002",
    "type": "USER2"
}
} 

一般来说没关系,您只需要添加一个逗号

{
"test1": {
    "id": "0001",
    "type": "USER"
}
, // comma here is important
"Test2": {
    "id": "0002",
    "type": "USER2"
}
} 

一般来说没关系,您只需要添加一个逗号

{
"test1": {
    "id": "0001",
    "type": "USER"
}
, // comma here is important
"Test2": {
    "id": "0002",
    "type": "USER2"
}
} 

一般来说没关系,您只需要添加一个逗号

{
"test1": {
    "id": "0001",
    "type": "USER"
}
, // comma here is important
"Test2": {
    "id": "0002",
    "type": "USER2"
}
} 

JSON是逗号分隔的。在每个key:value对之后必须有一个逗号,除非它是集合中的最后一个,例如

{ 
 "Item_1":{
    "Item_1_Param1": "Param1", // Comma required here
    "Item_1_Param2": "Param2"  // Comma not required here
 }, // Comma required here
  "Item_2":{
    "Item_2_Param1": "Param1", // Comma required here 
    "Item_2_Param2": "Param2"  // Comma not required here 
 }  // Comma not required here 

JSON是逗号分隔的。在每个key:value对之后必须有一个逗号,除非它是集合中的最后一个,例如

{ 
 "Item_1":{
    "Item_1_Param1": "Param1", // Comma required here
    "Item_1_Param2": "Param2"  // Comma not required here
 }, // Comma required here
  "Item_2":{
    "Item_2_Param1": "Param1", // Comma required here 
    "Item_2_Param2": "Param2"  // Comma not required here 
 }  // Comma not required here 

JSON是逗号分隔的。在每个key:value对之后必须有一个逗号,除非它是集合中的最后一个,例如

{ 
 "Item_1":{
    "Item_1_Param1": "Param1", // Comma required here
    "Item_1_Param2": "Param2"  // Comma not required here
 }, // Comma required here
  "Item_2":{
    "Item_2_Param1": "Param1", // Comma required here 
    "Item_2_Param2": "Param2"  // Comma not required here 
 }  // Comma not required here 

JSON是逗号分隔的。在每个key:value对之后必须有一个逗号,除非它是集合中的最后一个,例如

{ 
 "Item_1":{
    "Item_1_Param1": "Param1", // Comma required here
    "Item_1_Param2": "Param2"  // Comma not required here
 }, // Comma required here
  "Item_2":{
    "Item_2_Param1": "Param1", // Comma required here 
    "Item_2_Param2": "Param2"  // Comma not required here 
 }  // Comma not required here 

这里的逗号:
},“Test2”:
并确保所有属性名称遵循相同的符号。这里的逗号:
},“Test2”:
并确保所有属性名称遵循相同的符号。这里的逗号:
},“Test2”:
并确保所有属性名称遵循相同的符号。这里的逗号:
},“Test2”:
并确保所有属性名称都使用相同的符号。