var jsonArrStr = '[{"id":"100","name":"刘加料", "phone1":"111112222", "phone2": "12877777","address": "中国", "remark": "备注2", "operation": ""},{"id":"101","name":"张另国", "phone1":"55566777", "phone2": "13745345","address": "加格达奇", "remark": "备注2", "operation": ""}'; jsonArrStr=jsonArrStr+',{"id":"102","name":"王画国", "phone1":"55566777", "phone2": "13745345","address": "加格达奇", "remark": "备注2", "operation": ""} ]'; var tempData={"list":[]}; //临时对象 //var jsonArr = JSON.parse(jsonArrStr);//将字符串 转为 json对象 数组 JSON.parse要求 json格式 严格 //var jsonArr = JSON.parse(result.data);//从后端 得到的 json var jsonArr =eval('(' + result.data + ')');;//eval对 json格式要求低 for(var i=0,l=jsonArr.length;i<l;i++){ tempData.list.push(jsonArr[i]); //将 json对象 按格式要求 赋给 页面的 json数据对象 //for(var key in jsonArr[i]){ //alert(key+':'+jsonArr[i][key]); //console.log(key+':'+jsonArr[i][key]); //} } this.tableData=tempData.list;//赋给 页面的 json数据对象 //this.tableData=result.data; console.log(this.tableData.length); this.ListLoadData(); //重新加载 列表