如何删除从 api 返回的嵌套 json 对象,如下所示,并通过使用 jquery 以通用方式取消嵌套对象,将其显示为单个字段。这是我的 json 对象
"response": {
"content":
"[ {
"Id": 0,
"Name": "Some name",
"createdOnDate": "0001-01-01T00:00:00",
"keyValueList":
[
{
"Key": "key1",
"Value": "Sample Data key 1"
},
{
"Key": "key2",
"Value": "sample data key 2
] }]"
这是取消嵌套后的样子。
[{
"Id": 123,
"Name": "some name",
"createdOnDate": "2013-01-22T17:02:00",
"key1": "this is my key1",
"key2": "this is my key2"
}]