Fix “xyz.widget is not a function” when jQuerying in Drupal

The error looks like:

c.widget is not a function

Or:

d.widget is not a function

I get this error when I do theming or module development for Drupal. Basically this tells you that the file jquery.ui.widget.js is missing. check the code you were writting and add that file to Drupal like this:

1
drupal_add_js('misc/ui/jquery.ui.widget.min.js');

Further reading

Related links

Leave a Reply

Your email address will not be published. Required fields are marked *

*

* Copy this password:

* Type or paste password here:

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">