怎么取出json数组里面每一组的其中一个值?
[{taskpeoples:"2",tasknums:"10",awordpeoples:"2",awordnums:"10",daykey:"2016-4-21"},…...
[{taskpeoples: "2", tasknums: "10", awordpeoples: "2", awordnums: "10", daykey: "2016-4-21"},…]
0:{taskpeoples: "2", tasknums: "10", awordpeoples: "2", awordnums: "10", daykey: "2016-4-21"}
1:{taskpeoples: "2", tasknums: "12", awordpeoples: "2", awordnums: "12", daykey: "2016-4-22"}
2:{taskpeoples: "5", tasknums: "12", awordpeoples: "5", awordnums: "12", daykey: "2016-4-23"}
3:{taskpeoples: "2", tasknums: "7", awordpeoples: "2", awordnums: "7", daykey: "2016-4-24"}
4:{taskpeoples: "2", tasknums: "12", awordpeoples: "2", awordnums: "12", daykey: "2016-4-25"}我如何取出每组数据里面的日期组成一个数组?万分感谢! 展开
0:{taskpeoples: "2", tasknums: "10", awordpeoples: "2", awordnums: "10", daykey: "2016-4-21"}
1:{taskpeoples: "2", tasknums: "12", awordpeoples: "2", awordnums: "12", daykey: "2016-4-22"}
2:{taskpeoples: "5", tasknums: "12", awordpeoples: "5", awordnums: "12", daykey: "2016-4-23"}
3:{taskpeoples: "2", tasknums: "7", awordpeoples: "2", awordnums: "7", daykey: "2016-4-24"}
4:{taskpeoples: "2", tasknums: "12", awordpeoples: "2", awordnums: "12", daykey: "2016-4-25"}我如何取出每组数据里面的日期组成一个数组?万分感谢! 展开
1个回答
展开全部
function ajax(url,succ) {
var aj=window.XMLHttpRequest?new XMLHttpRequest():new ActiveXObject("Microsoft.XMLHTTP")
aj.open("get", url, true)
aj.send();
aj.onreadystatechange = function() {
if(aj.readyState == 4&&aj.status==200&&succ) {
succ(aj.responseText)
}
}
}
//上面是一个ajax方法。下面是使用。
ajax(url,fuction(res){
console.log(res)
})
//url是json文件的路径,res是获取到后的结果,结果是一个数组。在控制台你自己去看,该怎么提出来。
var aj=window.XMLHttpRequest?new XMLHttpRequest():new ActiveXObject("Microsoft.XMLHTTP")
aj.open("get", url, true)
aj.send();
aj.onreadystatechange = function() {
if(aj.readyState == 4&&aj.status==200&&succ) {
succ(aj.responseText)
}
}
}
//上面是一个ajax方法。下面是使用。
ajax(url,fuction(res){
console.log(res)
})
//url是json文件的路径,res是获取到后的结果,结果是一个数组。在控制台你自己去看,该怎么提出来。
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询