• Object function (a,b){return new p.fn.init(a,b,c)} has no method ‘widget’

    If you’re seeing this error message in Chrome:

    Object function (a,b){return new p.fn.init(a,b,c)} has no method 'widget'

    or this error in Firefox:

    TypeError: $.widget is not a function

    or this error in IE:

    Object doesn't support property or method 'widget'

    when you’re trying to use a jQuery UI widget then check that you’re including the necessary jQuery UI library. In my case I wanted the tabs library available on all pages of my Drupal site, so I needed to add the following hook to my theme:

    function THEME_preprocess_page(&$variables) {
    drupal_add_library(‘system’, ‘ui.tabs’);
    }

    Categories: Web development

    Tags: , ,