Possible Duplicate:
Javascript Objects: Dynamic variable names?
I have a json string passed in from a cgi script. This json string has a list of id’s. In javascript
var informationObj = jQuery.parseJSON(information);
tid = informationObj.idList[0].id;
tid is now an ID and I want to use it to access objects within the json string itself like so:
alert (informationObj.tid.rpath);
However this does not seem to work. I have also tried:
alert (informationObj.eval(tid).rpath);
Is there a way around this?
Thanks.
You need this form:
They are equivalent: