Type Error: c is not a constructor/c.widget is not a function

3.1k Views Asked by At

I am trying to get jQuery UI dialogs working on my drupal site. After checking the web console, I found that I was getting the error:

$(...).dialog is not a function

I did some researching (aka. googling) and I found that this could have been because I didn't add all the necessary js files to my drupal page. So I added jquery.ui.dialog.min.js and all of its dependencies. However, I am now getting the:

Type Errors: c is not a constructor and c.widget is not a function.

Since jquery.ui.widget.min.js doesn't depend on anything, I am not sure what to do...

also I haven't found any conclusive answers to these errors...

EDIT: js files added (in order):

jquery.ui.widget.min.js
jquery.ui.dialog.min.js
jquery.ui.button.min.js
jquery.ui.draggable.min.js
jquery.ui.mouse.min.js
jquery.ui.position.min.js
jquery.ui.resizable.min.js
my_module.js
1

There are 1 best solutions below

0
On

Figured it out. Just added:

drupal_add_library('system', 'ui');

Instead of each script separately.