Rene Rene - 1 year ago 79
Javascript Question

Get Json object or loop

I have the following json.


I need to get the values of the sockets, already tried with loop and several other ways more can not. Can someone help me?

Already I tried so

$.each(json, function(idx, obj) {

Answer Source
var obj= {"sockets":{"16":true},"length":1}

$.each( obj, function( key, value ) {
  alert(JSON.stringify(key) + ": " + JSON.stringify(value) );