js代码记录
function getAllIdsByNonKey(rows, key, val, name) {
var ids = "";//拼接字符串
if (rows.length != 0) {
for (var i=0, len=rows.length; i <len; i++) {
var obj = rows[i];
for ( var p in obj ){//循环
if (p == key && obj[p] != val) {
ids += (ids==""?"":",") + obj[(name? name : 'id')];
}
}
}
}
return ids;
}
浙公网安备 33010602011771号