Array.prototype.noRepeated=function(){  

var newArray=[], flags={};

for (var i=0;i<this.length;i++){    

   
var item= this[i];

   
if (!flags[item]) {  
   
    newArray.push(item);  
   
    flags[item]
= true;  
   
    }  
}  

return newArray;  

}


var a={"a":"0","b":"OK","c":[{"Account":"81614031","Time":"2012-11-26"},{"Account":"81614031","Time":"2012-11-26"}]}

var cItems=a.c;
var sourceArray= [];
$(cItems).each(function(index){
   
    sourceArray.push(cItems[index].Account)
   
});

sourceArray
=sourceArray.noRepeated();
alert(sourceArray.join(",")); 

=============================

var json_data=a;
var data={};
for(var i=0; i<json_data.c.length; i++){
  data[json_data.c[i].Account]
="";
}
var result="";
for(var p in data){
if(result==""){
result
=p;
}
else{
  result+=","+p;
  }
}
alert(result);

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-11
  • 2021-09-26
  • 2022-12-23
猜你喜欢
  • 2023-01-24
  • 2021-07-09
  • 2022-12-23
  • 2021-11-23
  • 2021-06-03
  • 2021-08-25
  • 2022-12-23
相关资源
相似解决方案