我正在使用 $.getJson() 函数返回位于单独 json 文件中的数组并将其存储到本地数组 var 中。我遇到的问题是,我只能从 json 中取回 25 个项目中的 20 个。$.getJson 是否有退货数量的限制?
这就是我使用代码的方式:
Javascript:
$.getJSON('data/gridData1.json',function(json){
console.log("Json length is: " + json.length);
var grid = json;
filterGrid(grid, ele);
});
杰森:
[
{"assignment":"Tom" , "cell":["Tom", "2013-10-06", "Client 3", "Activity", "Scheduled" ]}
,{"assignment":"Tom" , "cell":["Tom", "2007-10-06", "Client 2", "Alert" , "Work In Progress" ]}
,{"assignment":"Tom" , "cell":["Tom", "2013-10-06", "Client 3", "Activity", "In Progress" ]}
,{"assignment":"Tom" , "cell":["Tom", "2007-10-06", "Client 1", "Lead" , "Qualified" ]}
,{"assignment":"Tom" , "cell":["Tom", "2007-10-06", "Client 2", "Alert" , "Open" ]}
,{"assignment":"Jenny" , "cell":["Jenny" , "2007-10-06", "Client 1", "Notification" , "New" ]}
,{"assignment":"Jenny" , "cell":["Jenny" , "2007-10-06", "Client 3", "Lead" , "Qualified" ]}
,{"assignment":"Jenny" , "cell":["Jenny" , "2007-10-05", "Client 2", "Lead" , "Unqualified" ]}
,{"assignment":"Jenny" , "cell":["Jenny" , "2007-10-05", "Client 1", "Activity" , "In Progress" ]}
,{"assignment":"Jenny" , "cell":["Jenny" , "2007-10-05", "Client 3", "Lead" , "Qualified" ]}
,{"assignment":"Jenny" , "cell":["Jenny" , "2007-10-04", "Client 3", "Lead" , "Unqualified" ]}
,{"assignment":"Katie" , "cell":["Katie", "2007-10-06", "Client 2", "Activity" , "Draft" ]}
,{"assignment":"Katie" , "cell":["Katie", "2007-10-06", "Client 1", "Activity" , "Draft" ]}
,{"assignment":"Katie" , "cell":["Katie", "2007-10-06", "Client 2", "Activity" , "In Progress" ]}
,{"assignment":"Brad" , "cell":["Brad" , "2007-10-06", "Client 1", "Activity" , "Scheduled" ]}
,{"assignment":"Brad" , "cell":["Brad" , "2007-10-06", "Client 3", "Activity" , "Scheduled" ]}
,{"assignment":"Brad" , "cell":["Brad" , "2007-10-05", "Client 2", "Activity" , "In Progress" ]}
,{"assignment":"Brad" , "cell":["Brad" , "2007-10-05", "Client 1", "Alert" , "Work In Progress" ]}
,{"assignment":"Brad" , "cell":["Brad" , "2007-10-05", "Client 3", "Alert" , "Open" ]}
,{"assignment":"Brad" , "cell":["Brad" , "2007-10-04", "Client 3", "Notification" , "New" ]}
,{"assignment":"Hank" , "cell":["Hank", "2013-10-06", "Client 3", "Lead", "Unqualified" ]}
,{"assignment":"Hank" , "cell":["Hank", "2007-10-06", "Client 2", "Alert" , "Work In Progress" ]}
,{"assignment":"Hank" , "cell":["Hank", "2007-10-06", "Client 1", "Lead" , "Qualified" ]}
,{"assignment":"Hank" , "cell":["Hank", "2007-10-06", "Client 2", "Alert" , "Open" ]}
,{"assignment":"Mike" , "cell":["Mike" , "2007-10-04", "Client 3", "Notification" , "New" ]}
]
控制台日志显示结果: 20. 有什么我遗漏的吗?