Need help with iterating over a JSON object generated by PHP code in response to a web service request. Looking for guidance on rendering sub-objects in a select list, especially those with value indexes.
Can someone provide assistance on populating a select list using a JavaScript object structured like this?
This object contains multiple sub-objects each with label and value pairs.
data = object(
0 => object(
'label' = > 'test1',
'value' = > 1
),
1 => object(
'label' = > 'test1',
'value' = >
0 = > object(
'label' = > 'sub testing1',
'value' = > 1
),
1 = > object(
'label' = > 'sub testing2',
'value' = > 1
),
),
3 = > object(
'label' = > 'test3',
'value' = >
0 = > object(
'label' = > 'sub testing - test 3',
'value' = > 33
),
)
)