Search code examples
phpwordpressfine-uploader

FineUploader onComplete event not called


It's happening something quite strange to me. I'm trying to use this plugin, at friday I saw working it completelly fine.

But I don't know what happened... the onComplete event is not firing. I had tested several ways to define it, these:

var fineUploader = $('#fineUploader');
fineUploader.fineUploader({
    request:{
        endpoint: '/wp-content/plugins/innovation-factory/includes/php/endpoint.php'
    },
    callbakcs:{
        onComplete: function(id, name, responseJSON, xhr){
            console.log(responseJSON);
            debug.log({
                _id: id,
                _name: name,
                _responseJSON: responseJSON,
                xhr
            });
        }
    },
    onComplete: function(id, name, responseJSON, xhr){
        console.log(responseJSON);
        debug.log({
            _id: id,
            _name: name,
            _responseJSON: responseJSON,
            xhr
        });
    }

});
fineUploader.on('onComplete', function(id, name, responseJSON, xhr){
    console.log(responseJSON);
    debug.log({
        _id: id,
        _name: name,
        _responseJSON: responseJSON,
        xhr
    });
});

I had tested theese 3 ways one by one, separatly.

What I'm doing wrong?

PD: There is no errors in console, and the files are correctly saved...


Solution

  • The issue with your code is only caused by the fact that you spells "callbacks" wrong. If you fix your spelling error, the issue disappears.