-2

I have got some code from a website to use Fine Uploder, and im having some problems getting it to work.

Im getting the following error in my console

Uncaught TypeError: Object [object Object] has no method 'on' 

The code that im using is as follows:

    // Instantiate a Fine Uploader instance:
    $("#manual-fine-uploader").fineUploader({
        autoUpload: false,
        request: {
            endpoint: "/uploads_bucket"
        }
    }).on("complete", function (event, id, name, response) {
        submitForm.call(this);
    }).on('statusChange', function (event, id, oldStatus, newStatus) {
        if (newStatus === qq.status.CANCELLED) {
            submitForm.call(this);
        } 
    });

Any help would be greatly appreciated.

Cheers,

BigJobbies
  • 3,633
  • 11
  • 43
  • 66

1 Answers1

1

You really should be using a somewhat current version of jQuery. 1.6.4 is very old. If you insist on using a pre-1.7 version, use bind instead of on. Someone suggested using live, which, quite frankly, does not make any sense here. Do not use live. Again, replace on with bind in your code. The best solution would be to simply use a current version of jQuery.

Why shouldn't you use live? Well, Fine Uploader uses triggerHandler internally to trigger the events. Events triggered with triggerHandler do not bubble, and, as a result, will never hit your handler if you use live since live ALWAYS binds your handler to document.

Ray Nicholus
  • 19,538
  • 14
  • 59
  • 82