• Resolved jave.web

    (@javeweb)


    I am getting this JS error:
    n.addClass(...).position(...).trigger is not a function
    This breaks down to

                $container
                    .addClass('custom-position')
                    .position(reposition)
                    .trigger('popmakeAfterReposition');

    Which is an obvious bug, since jQuery .position() returns PLAIN OBJECT with just top/left properties, so no trigger can be called. Did you probably mean this?:

                $container
                    .addClass('custom-position')
                    .position(reposition);
                    
                $container.trigger('popmakeAfterReposition');

    …since that does not throw any JS error ?? and pop up works after this , it is weirdly moved a side but I guess that is some specific CSS issue ?? … but it seems you have just buggy responsive CSS ??

    • This topic was modified 7 years, 6 months ago by jave.web.
Viewing 5 replies - 1 through 5 (of 5 total)
  • I’m getting this error Uncaught TypeError: this._addClass is not a function
    which was not appearing before updating to 4.7.5
    I’m not even using directly, but a function of Jquery UI does:
    forgotPasswordDialog = jQuery(‘#forgotPasswordForm’).dialog({…})
    using jquery ui 1.12.0
    jquery appears to be 1.11.3
    Any clue on how to solve this?

    Thread Starter jave.web

    (@javeweb)

    @alexfbonilla that is a different error, so you should probably start a new topic about that, however these I my core jQuery things I am loading:

    • jquery.js?ver=1.12.4 (head)
    • jquery-migrate.min.js?ver=1.4.1 (head)
    • ui/core.min.js?ver=1.11.4 (footer)
    • ui/position.min.js?ver=1.11.4 (footer)

    Anyway, in your topic try to provide some more code context – more code, and files & relative paths from WP root where they are coming from…
    But from the selector #forgotPasswordForm I am guessing this is not related to this plugin?

    Plugin Author Daniel Iser

    (@danieliser)

    @javeweb – The error you listed only occurs when jQuery has been loaded more than once on the page. Some themes load a copy from apis.google.com for instance.

    So once ui/position.js has been loaded, if another copy of jQuery is loaded, the .position function no longer exists.

    To confirm .position(reposition) is chainable when using jQuery UI Position, so that is not an error in the code. Also that code hasn’t changed really since v1 and you would see everyone complaining as that code triggers the popups, meaning no popups would work.

    So generally once you remove the second copy of jQuery everything goes back to normal.

    If you want to post a link I would be happy to check it out.

    Hope that helps.

    Thread Starter jave.web

    (@javeweb)

    There is a second jQuery (3) ?? thanks.

    Plugin Author Daniel Iser

    (@danieliser)

    @javeweb – Not a problem. I have seen that at least 100 times in the last 2.5 years since PM became available. The error is almost always the same which makes it easy to spot ??

    Please take a moment to click that it Works and to rate and review the plugin or support.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘WP 4.7.5 – jQuery bug’ is closed to new replies.