Suppose json is:
Json code
[{"name":'a',"age":1,"sex":"0","title":"hello","state":"0 ","id":"1"},{"name":'b',"age":2,"sex":"1","title":"bye","state":"0", "id":"2"}]
The following is the method to get the length of the json object:
Js code
function getJsonObjLength(jsonObj) {
var Length = 0;
for (var item in jsonObj ) {
Length++;
}
return Length;
}
Js code
= = = = = = = = = = = = = = Determine whether the json object is empty = = = = = = = = = = = = = = = = = =
Js code