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+ajax(SSH)架构遇到的问题
- ckeditor编辑器为何高设置100%无效?但宽却有效,很神奇!
- 求助:如何通过XMLHttpRequest上传图片?
- 下拉选项框和提交按钮的一个问题
- 问个简单问题?
- img src=变量
- 如何用javascript查找距离某个标签最近的一个tag?
- AJAX聊天程序,客户端封闭成控件,并实现前后台完全分离!请大家多多批评指正!
- 页面传值的问题,b.htm为a.htm的弹出页面,a.htm又一个很长的字符需传给b.htm ?传值又长度限制,请问还又什么方法?
- 求教各位:javascript中关于数组调用的问题!
- 简单交互,能否用js实现?
- 怎样辨断iframe中当前编辑位置的html样式
只是ItemFileWriteStore解释不了而已
检查一下json映射对象的格式要求,看是否匹配
header('Content-type: text/x-json');
开始在存储的时候直接用数组给JSON的属性赋值了,所以报了这个错。
现在先转换成JSON string再存储,然后再读出来之后再用eval()把JSON String转换成JSON数组,就没有这个问题了。