Get Length Of Json object
jquery, json
Solution
I have got the answer
Object.keys(result).length // returns 5
UPDATE
From the comment this does not work on IE 7 and 8
Problem
I have json object which is returned from php file, the json values are as follows ``` { "0": { "id": "35", "name": "first name", "date": "2014-03-03", "age": "25" }, "1": { "id": "36", "name": "name", "date": "0000-00-00", "age": "25" }, "2": { "id": "37", "name": "myname", "date": "0000-00-00", "age": "25" }, "average_age": 25, "count": 3 } ``` How do I get the count of values other than average_age and count that is for the given json object i want to get 3 as length in jQuery