I\'m having trouble figuring out how to properly read my JSON response from a jQuery $.post() request.
In the below jQuery code, I populate an associative array of s
Ok then..the data object you're getting back from the post is: {"id":"abc","images":[{"color123":"somelink.com\/123","color223":"somelink.com\/223"}]};
If you change your alert, you'll find the values you're looking for:
$.post(
"test.php",
{ id: product_id, "images[]": jQuery.makeArray(image_links) },
function(data) {
var response = jQuery.parseJSON(data);
var images = response.images[0];
for (var i in images){
alert(images[i]);
}
}
);