给定这样的数据:
var json = [
{ "id": "A", "status": 1, "rank": 30, "score": 0.1 },
{ "id": "B", "status": 1, "rank": 30, "score": 0.7 },
{ "id": "C", "status": 1, "rank": 60, "score": 0.8 },
{ "id": "AB", "status": 1, "rank": 160, "score": 0.6 },
{ "id": "ABC", "status": 1, "rank": 400, "score": 0.2 }
];
如何获取 id 的长度?
小提琴:http: //jsfiddle.net/RBSC9/
以下不起作用:
var l = (json[3].id).text().length();
console.log("l = "+ l );