JSON_html/css_WEB-ITnose
程序员文章站
2022-03-20 21:45:14
...
请问 怎么将图中数据写成json形式。我的思路是学生在最外面是一个集合,每个学生对应所有公司。这么想有问题吗?
下面是我的json 但存在问题。如何引用对象gongsi? 或者怎么去修改 谢谢
[
{
"Student" :
[
{
"email" : "ab123",
"sid" : 123456789,
"city" : "Leicester",
"postcode" : "LE17HA",
"gongsi"
},
{
"email" : "zy987",
"sid": 987654321,
"city": "Leicester",
"postcode": "LE 17HA",
"gongsi"
}
}
]
var gongsi=
{
"Company":
[
{
"name": "JADU",
"city": "Leicester",
"postcode":
"LE19 1RG"
},
{
"name": "IBM",
"city": "Leicester",
"postcode": "LE 17HA"
}]
}
下面是我的json 但存在问题。如何引用对象gongsi? 或者怎么去修改 谢谢
[
{
"Student" :
[
{
"email" : "ab123",
"sid" : 123456789,
"city" : "Leicester",
"postcode" : "LE17HA",
"gongsi"
},
{
"email" : "zy987",
"sid": 987654321,
"city": "Leicester",
"postcode": "LE 17HA",
"gongsi"
}
}
]
var gongsi=
{
"Company":
[
{
"name": "JADU",
"city": "Leicester",
"postcode":
"LE19 1RG"
},
{
"name": "IBM",
"city": "Leicester",
"postcode": "LE 17HA"
}]
}
回复讨论(解决方案)
"gongsi":{
"Company":
[
{
"name": "JADU",
"city": "Leicester",
"postcode":
"LE19 1RG"
},
{
"name": "IBM",
"city": "Leicester",
"postcode": "LE 17HA"
}]
}
不就可以了吗?或者使用变量
推荐阅读
-
关于网页路径的疑惑_html/css_WEB-ITnose
-
Codeforces Round #156 (Div. 2)-A. Greg's Workout_html/css_WEB-ITnose
-
html 关于ul标签的_html/css_WEB-ITnose
-
background-size 设置背景图片的大小_html/css_WEB-ITnose
-
multiple backgrounds 多重背景_html/css_WEB-ITnose
-
建站新人_html/css_WEB-ITnose
-
折线图怎么做啊?急求!_html/css_WEB-ITnose
-
Codeforces Round #107 (Div. 2)-A. Soft Drinking_html/css_WEB-ITnose
-
css5种实现垂直居中_html/css_WEB-ITnose
-
求解如何在表格边框中设置颜色_html/css_WEB-ITnose