請問這個遍歷,遍歷的是誰,data是干什么用的?
$.getJSON("http://idcbgp.cn/data/sport.json",function(data){
??????????????????????? $this.attr("disabled", "true");
??????????????????????? $.each(data, function (index, sport) {
??????????????????????????? if(index==3)
??????????????????????????? $("ul").append("<li>" + sport["name"] + "</li>");
??????????????????????? })
2016-05-10
data代表你請求獲得的數(shù)據(jù)
2016-05-06
這個遍歷應(yīng)該是遍歷的第四個數(shù)據(jù)吧,index==3就是第四個,我是這么理解的,不知道對不對
2016-04-21
這個data就是從getJSON()的第一個參數(shù)url地址返回的數(shù)據(jù)內(nèi)容