判断一个对象是否是空
//判断一个对象是否是空 function isRealObject(obj){ if(typeof obj ==='object'){ for(var name in obj){ if(obj.hasOwnProperty(name)){ return true; } } } return false; }; //多图上传获取路径 var arr = []; for(var a=0;a<imgu.length;a++){ arr.push(imgu[a].getAttribute('src')); } var shopstring = ''; if(arr.length>0){ shopstring = arr.join(','); }else{ shopstring = ''; }
//判断一个对象是否是空
function isRealObject(obj){
if(typeof obj ==='object'){
for(var name in obj){
if(obj.hasOwnProperty(name)){
return true;
}
}
}
return false;
};
//多图上传获取路径
var arr = [];
for(var a=0;a<imgu.length;a++){
arr.push(imgu[a].getAttribute('src'));
}
var shopstring = '';
if(arr.length>0){
shopstring = arr.join(',');
}else{
shopstring = '';
}