It's probably because you're trying to read it as a string and not a JSON object?
alert(JSON.stringify(json));
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
This:
$(document).ready(function(){
$('.update').click(function(e) {
e.preventDefault();
var url = "http://clothing.app/updateProductOption";
var $post = {};
$post.id = $(this).attr('rel');
$post.size = $('#size_' + $post.id).val();
$post.colour = $('#colour_' + $post.id).val();
$post.stock = $('#stock_' + $post.id).val();
$.ajax({
type: "POST",
url: url,
data: $post,
cache: false,
success: function(data){
return data;
}
});
return false;
});
});
Now works YIPEEEEE!!!!!!1
Please or to participate in this conversation.