JSON文件的内容如下:
{
"identifier": "id",
"label": "name",
"items": [
{
"type": "schedule",
"id": "-1",
"name": "chkSchedule",
"schedule": "3,7,1,2,00"
},
{
"type": "devices",
"id": "00000019bb3258ea0000000300000002",
"name": "spa1db2",
"deviceType": "HP9000 HP-UX B.11.23",
"Monitoring": {
"Status": "1",
"StatusText": "The health check result is healthy.",
"AdditionalInfo": "Here is the additional infromation."
},
"Basic Colletion": null,
"Advanced Collection": null,
"SAN Server Collection": null
},
{
"type": "devices",
"id": "00000019bb3258ea0000000300000010",
"name": "cmserver",
"deviceType": "HP9000 HP-UX B.11.11",
"Monitoring": {
"Status": "1",
"StatusText": "The health check result is healthy.",
"AdditionalInfo": "Here is the additional infromation."
},
"Basic Colletion": null,
"Advanced Collection": null,
"SAN Server Collection": null
}
]
}好像是"Monitoring"这个对象的格式不对,去掉之后就可以正常读取JSON文件内的其他所有内容了,但是看不出哪里不对。
请牛人帮忙看一下,谢谢!
{
"identifier": "id",
"label": "name",
"items": [
{
"type": "schedule",
"id": "-1",
"name": "chkSchedule",
"schedule": "3,7,1,2,00"
},
{
"type": "devices",
"id": "00000019bb3258ea0000000300000002",
"name": "spa1db2",
"deviceType": "HP9000 HP-UX B.11.23",
"Monitoring": {
"Status": "1",
"StatusText": "The health check result is healthy.",
"AdditionalInfo": "Here is the additional infromation."
},
"Basic Colletion": null,
"Advanced Collection": null,
"SAN Server Collection": null
},
{
"type": "devices",
"id": "00000019bb3258ea0000000300000010",
"name": "cmserver",
"deviceType": "HP9000 HP-UX B.11.11",
"Monitoring": {
"Status": "1",
"StatusText": "The health check result is healthy.",
"AdditionalInfo": "Here is the additional infromation."
},
"Basic Colletion": null,
"Advanced Collection": null,
"SAN Server Collection": null
}
]
}好像是"Monitoring"这个对象的格式不对,去掉之后就可以正常读取JSON文件内的其他所有内容了,但是看不出哪里不对。
请牛人帮忙看一下,谢谢!
解决方案 »
- 怎么使用jQuery解析这段json类型的数据
- slideToggle 和toggle 用法上有什么区别呢
- js右键菜单控制,只要菜单消失 但是还要能响应别的事件
- 请教下复选框的问题
- 关于Select框选项的问题,高手请进,急,在线等待
- RegExp问题
- 怎样获得window.showModalDialog('aa.htm', window, 'dialogHeight:100px;dialogWidth:300px;center:yes;status:no;')的返回值
- 框架集里的页面怎么取得request值?----孟子E章请帮忙
- 需要修改什么参数?
- 请教两个问题?
- 简单交互,能否用js实现?
- 怎样辨断iframe中当前编辑位置的html样式
只是ItemFileWriteStore解释不了而已
检查一下json映射对象的格式要求,看是否匹配
header('Content-type: text/x-json');
开始在存储的时候直接用数组给JSON的属性赋值了,所以报了这个错。
现在先转换成JSON string再存储,然后再读出来之后再用eval()把JSON String转换成JSON数组,就没有这个问题了。