I have some JavaScript that processes data returned from a Web service call:
var jsonObject = eval('obj=' + data);
var result = jsonObject['GetOffices']['offices'];
The value of the 'result' variable is:
[{"streetAddress":"1501 Main Street","phone":"703-123-4567","postalCode":"12345","fax":"703-883-4037","name":"Remote Office #3","state":"VA","poid":"BO^NORA.MIM.Users.Office^2679e3af:126776b793e:-8000","className":"Office","country":"USA","city":"Anytown"}]
How can I convert this string value to a JavaScript array, and then how can I get the value of an attribute, such as 'name'?
var jsonObject = eval('obj=' + data);
var result = jsonObject['GetOffices']['offices'];
The value of the 'result' variable is:
[{"streetAddress":"1501 Main Street","phone":"703-123-4567","postalCode":"12345","fax":"703-883-4037","name":"Remote Office #3","state":"VA","poid":"BO^NORA.MIM.Users.Office^2679e3af:126776b793e:-8000","className":"Office","country":"USA","city":"Anytown"}]
How can I convert this string value to a JavaScript array, and then how can I get the value of an attribute, such as 'name'?