• Resolved eric3d

    (@eric3d)


    I kept getting the following errors:
    [Error] ReferenceError: Can’t find variable: jQuery
    global code (jquery.adrotate.dyngroup.js, line 112)
    [Error] ReferenceError: Can’t find variable: jQuery
    global code (jquery.adrotate.clicktracker.js, line 29)

    I tracked it down to jQuery being loaded after those scripts, then to the fact that the dependency was not set for those scripts.
    Adding array( ‘jquery’ ) to lines 467 and 468 of adrotate-output.php fixes that problem. Please include it in the next version.

    if(get_option('adrotate_dynamic_required') > 0) wp_enqueue_script('jshowoff-adrotate', plugins_url('/library/jquery.adrotate.dyngroup.js', __FILE__), array( 'jquery' ), null, $in_footer);
    if(get_option('adrotate_responsive_required') > 0) wp_enqueue_script('responsive-adrotate', plugins_url('/library/jquery.adrotate.responsive.js', __FILE__), array( 'jquery' ), null, $in_footer);

    https://wordpress.org/plugins/adrotate/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Arnan de Gans

    (@adegans)

    That only works if the user (you) is not using some 3rd party jQuery version. Otherwise my scripts would load the WordPress included one, breaking your 3rd party version.

    If you need jQuery and it’s not included elsewhere you can load jQuery from AdRotate settings. if the loading order is wrong, check the option to load Javascripts in the footer to sort that out.

    Thread Starter eric3d

    (@eric3d)

    Thanks for the explanation.

    Plugin Author Arnan de Gans

    (@adegans)

    Once people finally stop using 3rd party libraries that are also included in WP already I’d be the first to add proper dependencies!
    It’ll make things a bunch easier 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘jquery dependency missing’ is closed to new replies.