如何检索Json属性 [英] how to retrive Json Attributes

查看:128
本文介绍了如何检索Json属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我拥有json,如下所示...
现在在javascript中,我可以使用
获取json的详细信息
list.oneitem或list.otherItemList [0] .Item

但是如何从没有属性名称的列表中获取项目
光泽还看吗?我想要GML.如果我做list.GlossSeeAlso [0]我得到对象如何转换为字符串? eval对我不起作用.


清单[{
"oneitem":值",
"otherItem":"value2"
"otherItemList":{[
"Item":"ItemValue"]}
"GlossSeeAlso":["GML","XML",标记"]


任何帮助都可以申请..

I haev json something like given below...
now in javascript i am able to get the details of json with

list.oneitem or list.otherItemList[0].Item

but how to get the item from list with no attribute name
GlossSeeAlso ? i want GML. if i do list.GlossSeeAlso[0] i get Object how to convert to string? eval is not working for me.


list[{
"oneitem":"value",
"otherItem":"value2"
"otherItemList":{[
"Item":"ItemValue"]}
"GlossSeeAlso": ["GML", "XML", "markup"]


any help is appriciated..

推荐答案

您好!

1.您的JSON似乎已修复.我无法解码.
2. list.oneitem不起作用.最多是列表[0] .oneitem

请发布正确的JSON.
Hello!

1. Your JSON seems to be f*cked up. I cannot decode it.
2. list.oneitem shouldn''t work. It most be list[0].oneitem

Please post correct JSON.


这篇关于如何检索Json属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆