日期:2014-05-19  浏览次数:20782 次

解析数据[7,11781994,'-0.64','0.52','0-0.5',1]]
[[10979787,0,3000.00],[1,11781896,'-0.84','0.76','0-0.5',1],[3,11781897,'-0.83','0.73','2.50'],[7,11781994,'-0.64','0.52','0-0.5',1]]








这种格式的数据怎么解析

------解决方案--------------------
二维数组

Java code
var array = [[10979787,0,3000.00],[1,11781896,'-0.84','0.76','0-0.5',1],[3,11781897,'-0.83','0.73','2.50'],[7,11781994,'-0.64','0.52','0-0.5',1]];
        
        for(var i = 0;i <array.length;i++){
            for(var j = 0;j < array[i].length;j++){
                alert(array[i][j]);
            }
        }

------解决方案--------------------
LZ正解
------解决方案--------------------
额 盗版一下
<script type="text/javascript">
var array = [[10979787,0,3000.00],[1,11781896,'-0.84','0.76','0-0.5',1],[3,11781897,'-0.83','0.73','2.50'],[7,11781994,'-0.64','0.52','0-0.5',1]];

for(var i in array){
for(var j in array[i]){
document.write(i+""+j+":"+array[i][j]+"<br/>");
}
}
</script>