后台java代码,生成Map数据
if (Collections.isNotEmpty(vidList)) {
this.dtcMap = new HashMap<String, Object>();
for (String vid : vidList) {
boolean isExist = (iCache.get("EMC" + vid) != null);
// LOGGER.info("******************************** vid = " + iCache.get("EMC" + vid));
if (isExist) {
dtcMap.put(vid, iCache.get("EMC" + vid));
}
}
}前台Jquery操作
function getDtcAndGps() {
$.Ajax( {
url : $.webPath + 'obd/monitor/getMonitorRtDtc.do',
success : function(data) {
if (data.errMsg) {
$.alert(data.errMsg);
} else {
$("#carContentDiv").empty();
var html = "";
$.each(data.dtcMap, function(key, value) {
html += "<div id='" + key + "' class='carImg'>A:<img src='" + $.webPath
+ "resources/images/demo/car1.jpg' class='carIcon'/>" + key
+ "</div>";
// html += value;
// html += key;
});
$(html).appendTo("#carContentDiv");
// $.alert(data.dtcMap);
}
}
});
}
Copyright © 2019- appcontents.com 版权所有
违法及侵权请联系:TEL:199 18 7713 E-MAIL:2724546146@qq.com
本站由北京市万商天勤律师事务所王兴未律师提供法律服务