#1126 ✓invalid
Disco Justice

responseJSON is not being populated

Reported by Disco Justice | August 23rd, 2010 @ 05:13 PM

I've been using code like that shown below to process simple forms quickly, but since I tried 1.7 RC2, it no longer works. The issue seems to be that transport.responseJSON does not get populated, and returns as "undefined".

Event.observe($('postForm'), 'submit', function(event) {

$('postForm').request({
    method: 'post',
    onComplete: function(transport){
        jsonObj=transport.responseJSON;
        if (jsonObj.success==1){
            // Success code goes here
        } else {
            // Show the message that was returned
            alert(jsonObj.message);
        }
    }
});
Event.stop(event);



});

The response is definitely valid JSON, and has the application/json header. Reverting back to 1.6.1 fixes this issue immediately.

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

The Prototype JavaScript library.

Shared Ticket Bins

People watching this ticket

Pages