#474 ✓resolved
ruslan

onComplete and JSON in Xhr

Reported by ruslan | August 4th, 2011 @ 03:01 AM

if your code looks like that:
var xhr = new Xhr('/some/url/', {

    onComplete: function(request) {
        if (request.successful()) {
            var json = request.responseJSON;
            // json is undefined
        }
    }
,).send();

you will never get JSON content because in stateChanged "complete" fired before "success"
(2.2.3 - line 4568 in right-src.js) and tryScripts will be called after your code

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 ยป

RightJS Core Tickets

Shared Ticket Bins

People watching this ticket

Pages