Search code examples
jqueryjquery-widgets

jquery and classes


I have 2 classes:

$.widget('blueimp.fileupload', {
    a: function  {}
})

$.widget('blueimpUI.fileupload', $.blueimp.fileupload, {
    b: function  {}
})

I want to replace my first two functions with a single class.

Function b works but function a doesn't. Why?

$.widget('blueimpUI.fileupload', $.blueimpUI.fileupload, {
    a: function  {},
    b: function  {}
})

Solution

  • Something like this might work better:

    $.widget('blueimpUI.fileupload', {
        fileupload: $.blueimp.fileupload, 
        a: function  {},
        b: function  {}
    });