判断一个对象是否是空

//判断一个对象是否是空        
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 = ''; 
}
posted @ 2018-02-07 14:55  六娃的博客  阅读(170)  评论(0编辑  收藏  举报