当我提醒结果时,我得到了以下JSON数据:
var results = JSON.stringify(result.results);
alert(results);
[{
"test": "Connect_Disconnect222222",
"jobid": "59",
"os": "Windows NTeeeeeee",
"report": "Verify Wireless Interface presenttttttttt and state is Disconnected:OK<br>Verify Profile not present on the Client:OK Client:OK<br>Verify Profile Not Present on the Client:OKffffffffffff<br>"
}]
如何从该数据中获取值report
,test
和jobid
?
答案 0 :(得分:3)
result.results
是一个数组对象,因此您需要获取数组中的第一项,然后获取其属性
var record = result.results[0];
alert(record.test)
alert(record.jobid)
alert(record.report)
答案 1 :(得分:0)
当你使用JsonArray
时,你必须定义行号,例如
alert(results[0].report);
alert(results[0].test);
alert(results[0].jobid);