JQuery widget has no extend method

I am working on a Wordpress site that contains several jQuery and jQuery UI-dependent plugins. Everything seemed to be working fine, but when we moved the entire site to the new domain name, I started to see the following error on the Chrome console:

Uncaught TypeError: object function (b, c, d) {var e = b.split (".") [0], f; b = b.split (".") [1], f = e + "-" + b, d || (d = C, C = a.Widget), a.expr [":"] [F] = function (s) {return !! a.data (c, b)}, a [e] = a [e] || {}, a [e] [b] = function (a, b) {arguments.length && this._createWidget (a, b)}; var g = new c; g.options = a.extend (0, {}, g.options!), and [e] [b] .prototype = a.extend (0, g, {Namespace: e, widgetName: b, widgetEventPrefix !: a [e] [b] .prototype.widgetEventPrefix || b, widgetBaseClass: f}, d), a.widget.bridge (b, a [e] [b])} does not have a 'extend' method

Here is the line in jQuery UI 1.9.3, which apparently causes this:

this.options = $.widget.extend( {}, this.options, this._getCreateOptions(), options ); 

I seem to be unable to get past this, no matter what I tried to do. I use the correct method (or so I read) to add scripts using wp_enqueue_script () and set jquery as a jquery-ui dependency and view HTML, jQuery really loads before the jQuery UI.

If anyone knows what might happen, I would really appreciate it. It turns me on.

+8
javascript jquery jquery-ui wordpress typeerror
source share
1 answer

This is not the answer to your problem, but to illustrate this, it sometimes seems like you have a jQuery error when you really have an error with your custom javascript.

If you use Chrome, you can open the console (Tools> Javascript console) and spin a small arrow on your error. This will show you all the lines of code that caused the error.

See image:

Use the console to find the line error

Often, if you look down the list, this will result in a different javascript than jQuery. If you click on the black links on the right (i.e. Activity.php), it will open the breaking lines if it is javascript.

Another problem (if you are using Wordpress) is that you can download jQuery twice. It looks like you did it right, however, it is possible that one of your plugins did not.

Edit What version of jQuery are you using (sorry misread jquery ui)

From the documentation: Ninja Forms uses the jQuery (javascript library) version that ships with WordPress. This means that if you use an external jQuery file or another plugin loads its own version of jQuery, errors may occur. For example, if you use WordPress version 3.3 or higher, Ninja Forms expects your site to have version 1.7 of jQuery. If you have a theme or plugin that changes this to an earlier version of jQuery, the Ninja form may not work correctly.

+7
source share

All Articles