On 03/25/2011 09:25 AM, Jagget wrote:
> Hello, Everyone!
>
> I receive JSON from server. JSON may be different. For example,
> "*[{"status":"ok"},{"name":"test"}]*". If I know, what field "status"
> exist, then I can check it value: *resp[0].status*. But I dont know
> it, I need determine, what object's name *IS *'status'. Is it
> possible? How can I do this?
Something like this?
for (var i=0, j=resp.length; i<j; i++) {
if ("undefined" !== typeof(resp[i].status)) {
var status = resp[i].status;
break;
}
}
alert("The status is: " + status);
Marc
------------------------------------------------------------------------------
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software
be a part of the solution? Download the Intel(R) Manageability Checker
today! http://p.sf.net/sfu/intel-dev2devmar
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel