MBA智库

[数组] {对象} 取数组用for 取对象用点

$.ajax({
                  type:"post",
                  async:false,
                  url:"data.php",
                  data:{},
                  dataType:"json",
                  success:function(result){

				  //[{"public_zao":53,"public_zhong":54,"public_wan":53},{"public_zao":56,"public_zhong":59,"public_wan":57},{"public_zao":62,"public_zhong":114,"public_wan":93},{"public_zao":58,"public_zhong":113,"public_wan":90}]
				  //  [数组]   {对象} 取数组用for 取对象用点
                    if (result) {
                      for (var i = 0; i < result.length; i++) {
                          arr1.push(result[i].public_zao);//push() 方法可向数组的末尾添加一个或多个元素,并返回新的长度。
                          arr1.push(result[i].public_zhong);
						  arr1.push(result[i].public_wan);
                      }
                    }
                  }
                })

  

posted @ 2019-08-20 11:41  冷色008  阅读(420)  评论(0编辑  收藏  举报