/*============================================ 函数功能:对返回数据中的列表数据进行非空处理 =============================================*/ function formatResponseData(response, str) { // 判断入参是对象还是集合, 然后不同的处理 var cxlb = response.toString() == "[object Object]" ? response.cxlb : toString.apply(response) == "[object Array]" ? response : []; str = str == undefined ? "--" : str; for(var i = 0 , len = cxlb.length; i < len; i++) { for(var j = 0, len2 = cxlb[i].length; j < len2; j++) { cxlb[i][j] = cxlb[i][j] == undefined || cxlb[i][j] == null || cxlb[i][j].trim() == "" ? str : cxlb[i][j]; } } }
本文转自农夫山泉别墅博客园博客,原文链接:http://www.cnblogs.com/yaowen/p/5574923.html,如需转载请自行联系原作者