jquery处理JSONArray

var bcvList = eval('<c:out value="${tbsiai}" escapeXml="false"/>');

//tbsiai是个json字符串(后台由JSONArray.toSting()得到),比如:[{MONITORING_INDEX_ID=e2031e3ead9b4dc18e2ac7176bf99a40, BACKGROUND_VALUE=}, {MONITORING_INDEX_ID=654b0490572f4ef1b577cfc60372cb1a, BACKGROUND_VALUE=}, {MONITORING_INDEX_ID=e1b3778fc0b948998691a4b467a3d802, BACKGROUND_VALUE=0.3}, {MONITORING_INDEX_ID=893ea40b78b343e798012857d1b67423, BACKGROUND_VALUE=0.0}]

$.each(bcvList, function(i, item) {
 alert(item.MONITORING_INDEX_ID + "\t" + item.BACKGROUND_VALUE);
});

相关推荐