【发布时间】:2015-01-13 13:26:22
【问题描述】:
我如何将对象 muxEnviroments 作为字符串?我想分析和比较以检查我必须期待什么类型的内容。
console.log(obj) 向我展示了整个对象。
我的目标是这样的:
jsonObjectName = obj;
if(jsonObjectName =='muxEnviroments'){do the stuff...}
但是如何将名称“muxEnviroments”作为字符串获取?
{
"muxEnviroments": [
{
"primaryTransmitterName": "sfu5",
"primaryTransmitterIp": "10.7.50.1"
},
{
"primaryTransmitterName": "sfu1",
"primaryTransmitterIp": "10.7.50.4"
}
]
}
【问题讨论】:
标签: javascript json string object