• Resolved Steven

    (@spstieng)


    I need to use the lates jQuery for my WP installation. Default version is 1.2.6.

    This is what I try and here are the results:

    Test 1 / adding jQuery through a plugin

    ### Function: add javascripts
    add_action('init', 'add_scripts');
    
    function add_scripts() {
    
        wp_enqueue_script('jQuery');
    }

    Test 2 / adding jQuery through a plugin

    ### Function: add javascripts
    add_action('init', 'add_scripts');
    
    function add_scripts() {
    
        wp_enqueue_script('jQuery', WP_PLUGIN_URL . '/wp-my/new/plugin/js/jQuery.js');
    }

    Looking at the source code, I see this:
    <script type=’text/javascript’ src=’http://localhost/dev2/wp-content/plugins/wp-store-locator/js/jQuery.js?ver=2.7.1′></script&gt;

    Version 2.7.1? Looking at jQuery.js, it says v1.3.6…..

    And what about replacing the old jQuery.js with the new version? IS that good or bad?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter Steven

    (@spstieng)

    Oh yeah…… that was just in the frontend.
    Looking at the backend (administration), it suddenly has added this line too:
    <script type='text/javascript' src='http://localhost/dev2/wp-includes/js/jquery/jquery.js?ver=1.2.6'></script>

    Now this will certainly crash. How the h*** can I avoid wp-admin adding this last line?

    Thread Starter Steven

    (@spstieng)

    Shit…. I posted this in the wrong catgory. Should offcours be in the Troubleshooting part.

    I found this thread. Its about using wp_deregister_script(‘jquery’).

    I will test his now ans see what happends. My guess a lot of admin stuff will break 🙁

    Thread Starter Steven

    (@spstieng)

    Ah crap. This suxx.

    Using jQuery version 1.3.7 in wp-admin do indeen break the admin functionality.

    So much for craeating plugins 🙁

    Does anyone know if WP is upgrading jQuery anytime soon?

    Thread Starter Steven

    (@spstieng)

    Oh… btw.

    I still have a plugin to add the newest jQuery.
    It basically looks like this:

    if ( !is_admin() ) // using a newer version of jQuery will break stuff in WP admin
         {
          wp_deregister_script('jquery');
          wp_enqueue_script('jQuery', WP_PLUGIN_URL . '/wp-store-locator/js/jQuery.js');
    
         }

    Thank you spstieng — this last snippet was exactly what I needed to force the use of my updated copy of jquery

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Is it possible to upgrade jQuery in WP?’ is closed to new replies.