WordPress.org

Ready to get started?Download WordPress

Forums

wp_enqueue_script('jquery') stopped working after upgrade to 2.8.2 (8 posts)

  1. spstieng
    Member
    Posted 4 years ago #

    I have a plugin where I call:

    wp_enqueue_script('jquery');
        wp_enqueue_script('jquery-ui-core');

    After I upgraded to v2.8.2, this scripts are noe longer loaded.

    Has anyone else experienced similar problems?

  2. tiggsy
    Member
    Posted 4 years ago #

    Could this problem cause these problems:

    1. Can't switch between visual and html tabs. Visual (active) tab is blank apart from some faint red underscores

    2. Edit timestamp link does not work

    These 2 were enough for me to give up.

    I've tried:
    a. logging out and back in, no difference
    b. disabling all the plugins, no difference
    c, reinstalling (had to do it manually), no difference

  3. trumpetmic
    Member
    Posted 4 years ago #

    Yes, I upgraded and now jQuery scripts that use $ aren't working. If I replace the "$" with "jQuery", then it works.

    I guess this has something to do with jQuery running in safe mode here, but these scripts were working before this upgrade on my site.

    Why is that?

    Is there a way to get that back?

    I'm not interested in wrapping every bit of script in a function, or changing everything from $ to jQuery.

    Ideas?

  4. rbevers
    Member
    Posted 4 years ago #

    I too had a problem with the $ notation.

    I found something that seems to fix this

    <script type="text/javascript">
    jQuery.noConflict();
    </script>

    This seems to check which library should use $ for compatibility with other
    frameworks. But if it doesn't find any conflicts it reverts to jQuery. You will
    then be able to use both jQuery and $ notation in your code.

    Hope this works for you too, just make sure you call it before the code that
    uses $.

  5. mayG
    Member
    Posted 4 years ago #

    I was wondering why suddenly my wp_enqueue_script( 'comment-reply' ); wp_enqueue_script( 'jquery' ); and a couple of others were not working after a WP upgrade.

    for jQuery i tried using the script tag and it started to work fine..
    <script type="text/javascript" src="<?php echo get_settings('home'); ?>/wp-includes/js/jquery/jquery.js"></script>

    no clue how my nested comments thing will start working again.. even the script tag isn't helping the situation :|
    <script type="text/javascript" src="<?php echo get_settings('home'); ?>/wp-includes/js/comment-reply.js"></script>

    Has anybody encountered a similar problem?

  6. tzmartin
    Member
    Posted 4 years ago #

    Instead of renaming $ to jQuery, you can use this wrapper:

    (function($){
        // Insert code...
    
    })(jQuery);
  7. munikho
    Member
    Posted 4 years ago #

    Stopped working for me as well. I don't think it has much to do with noConflict. It's not loading the file all together.

  8. aradams
    Member
    Posted 4 years ago #

    With the small script I was using, renaming $ to jQuery enabled wp_enqueue_script to work as it should. This would be a real pain for older scripts, however...

Topic Closed

This topic has been closed to new replies.

About this Topic