Error in firefox: $ .widget is not a function

I have several multi-zone cells from the jQuery user interface on a page that works fine in Chrome and Safari but not in Firefox for some reason ... when I load the error console in Firefox, I see:

Error: $.widget is not a function Source File: http://localhost:3000/javascripts/jquery.multiselect.js?1302660373 Line: 563 

Any ideas why?


edit: the line itself is located within the open function on the right, where it says "// respond to parameter changes after initialization"

  // open the menu open: function(e){ var self = this, button = this.button, menu = this.menu, speed = this.speed, o = this.options; widget: function(){ return this.menu; }, // react to option changes after initialization _setOption: function( key, value ){ var menu = this.menu; switch(key){ case 'header': menu.find('div.ui-multiselect-header')[ value ? 'show' : 'hide' ](); 
+8
firefox jquery-ui widget
source share
4 answers

I assume that you are using the jQuery Multiselect and hellip plugin; which depends on the jQuery user interface.

It looks like you haven't included enough jQuery UI libraries or just nothing. You need to enable the main parts of the jQuery user interface (including Widget ) if you create a custom download. Or just download the whole jQuery UI and enable it.

+15
source share

For everyone who gets it, but has requirements; make sure you include the javascript files in the correct order. This error is caused because my jquery-ui.js is included after the multiselect js file.

+2
source share

Actually, if you get this error, then it is either

a) for @andyb answer - you did not specify the correct jQuery user interface components

OR

b) your DOM is not yet loaded with the correct $.widget , and therefore your function is trying to call before $.widget . to fix the problem, make sure $ .widget is called before your function

0
source share

This answer is probably not related to the situation of the questionnaire, but I put it here for other Googling questions.

I got this error using Rails 3.2 and fixed it by deleting (renaming) the public / assets folder. There seem to be many more problems with the asset pipeline. I don't know the details, but I had other Javascript errors that were fixed in this way.

0
source share

All Articles