Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8047781
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T06:12:45+00:00 2026-06-05T06:12:45+00:00

Our drupal site runs with jQuery version 1.2.1 which we have not upgraded. The

  • 0

Our drupal site runs with jQuery version 1.2.1 which we have not upgraded.

The problem is this:

We need to add a new plugin named jQuery Tokeninput, but it’s working only in latest jQuery versions. We tried adding the latest jQuery version with old version, but it produces weird results.

My question is, how to include the latest jQuery file without affecting the old jQuery plugins?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T06:12:48+00:00Added an answer on June 5, 2026 at 6:12 am

    Method #1: (recommended)

    You could do something like this:

    <script type='text/javascript' src='js/jquery_1.7.1.js'></script>   
    <script type='text/javascript'>  
     // In case you wonder why we pass the "true" parameter,
     // here is the explanation:
     //   - When you use jQuery.noConflict(), it deletes
     //     the "$" global variable.
     //   - When you use jQuery.noConflict(true), it also
     //     deletes the "jQuery" global variable.
     var $jq = jQuery.noConflict(true);  
    </script>  
    <script type='text/javascript' src='js/jquery_1.2.1.js'></script> 
    

    And this way when you want something made with the new version of jquery instead of the $ use $jq.

    $jq('.selector').on('click', function(){  
        //do something  
    });
    

    Method #2: (might break things on your site – not recommended)

    In your template.php file:

    <?php
    function {theme_name}_preprocess(&$vars, $hook) {
    if (arg(0) != 'admin' && $hook == "page") {
    // Get an array of all JavaScripts that have been added
    $javascript = drupal_add_js(NULL, NULL, 'header');
    
    // Remove the original jQuery library
    unset($javascript['core']['misc/jquery.js']);
    
    // Add in our new jQuery library
    // We do it this way to keep the includes in the same order
    $core = array(
    //Alternative jQuery
    drupal_get_path('theme', '{theme_name}').'/js/libs/jquery-1.7.1.min.js' => array(
    'cache' => TRUE,
    'defer' => FALSE,
    )
    );
    
    // Merge back into the array of core JavaScripts
    $javascript['core'] = array_merge($javascript['core'], $core);
    
    // Rerender the block of JavaScripts
    $vars['scripts'] = drupal_get_js(NULL, $javascript);
    }
    }
    

    Be sure to only do this on the frontend of your site. It can mess up admin toolbars if they are dependent on Drupal’s version of jQuery.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a rather complicated deploy setup for our Drupal site that is a
We have a intranet site that runs on Drupal. If an employee hits the
I have a Drupal site, site.com , and our client has a campaign that
We have a PHP/MySQL site and we need to connect to a Drupal site
We are tying to perf tune our drupal site. We are using Siege to
Our team (QA) is facing the following problem: We have a database that is
I have added two modules in my drupal site called.... 1. me alias 2.
While migrating our drupal site from a hosting company to our main server. I
We have a basic drupal multi-site installation on a RHEL (RedHat) server. For some
We're upgrading a large site, opendemocracy.net, from Drupal 4.7 to Drupal 6. Our existing

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.