Hi,
You're looking for the JSON in the second parameter to onSuccess, but
that's the result of evaling the X-JSON *header*. From
http://www.prototypejs.org/api/ajax/options:
"...all callbacks (except onException) are invoked with two
parameters: the XMLHttpRequest object and the result of evaluating the
X-JSON response header, if any (can be null)."
You're sending JSON back as the body of the response, not in an X-JSON
header. If you do that, use transport.responseJSON in your onSuccess
handler:
onSuccess: function(transport){
alert(transport.responseJSON ?
Object.inspect(transport.responseJSON) : "no JSON object");
},
Or if you really want to send an X-JSON header (where the body of the
response is something else), you'll have to modify your PHP to do
that.
HTH,
--
T.J. Crowder
tj / crowder software / com
On Oct 7, 2:54 am, liketofindoutwhy <
liketofindout...@gmail.com>
wrote: