All right. It's my turn to cry and weep in despair.
FF 3.6.11, Firebug 1.5.4, PHP 5.3.1.
I hate JSON, btw.
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: "joaca2.php",
data: '{"name":"George"}',
dataType: "json",
success: function(response){
alert(response);
}
});
That's the JS part (with some HTML, ofc. Everything works fine in that doc).
I've tried {name:"George"} also.
Here's the monstrous PHP code:
printf("<pre>%s</pre>", print_r($_POST, 1));
Here the POST'ed data in Firebug: http://i56.tinypic.com/71l1r4.png
And here's the HTML response: http://i54.tinypic.com/2ptqfi9.png
What's wrong? json_decode? Nah, it just shouts that the first argument needs to be string, "array given".
I lost a whole night with this damn JSON and I won't give up until I get something right, no matter how little.
Thanks, as always.