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

  • SEARCH
  • Home
  • 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 7735869
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T07:36:29+00:00 2026-06-01T07:36:29+00:00

So, let’s start with situation. I have a website which uses Jquery 1.4.2 as

  • 0

So, let’s start with situation. I have a website which uses Jquery 1.4.2 as the main version of Jquery.
But user’s are able to use custom templates which are using other versions(1.2.1,1.5.1,etc.). So it bring with it conflicts in some situations.
For example, here

//included in my main view
<script type="text/javascript" src="jquery-1.4.2.min.js" ></script>
<script type="text/javascript">
        $(function () {
              alert($().jquery);
          });
</script>

//included in custom template
<script type='text/javascript' src='jquery-1.5.1.min.js'></script>
<script type="text/javascript">
        $(function () {
          alert($().jquery);
        });
</script>

So both of them are alerting 1.5.1(because of initializing when document is ready). So I want to prevent this situations.

Now I’ve get only one solution in my head – use noConflict(true) and change all $ and Jquery symbols to new symbol in all plugins used in my site.
Is there more elegant solution or I really need to rename all plugin’s used in my site?

P.S. Another way maybe will be using backwards compatibility plugins, but in this situation I will need to include a lot of plugins to make it compatible with all versions.

  • 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-01T07:36:30+00:00Added an answer on June 1, 2026 at 7:36 am

    Look at jQuery.noConflict()

    **//included in my main view**
    <script type="text/javascript" src="jquery-1.4.2.min.js" ></script>
    <script type="text/javascript">
            $(function () {
                  alert($().jquery);
              });
    </script>
    
    **//included in custom template**
    <script type='text/javascript' src='jquery-1.5.1.min.js'></script>
    <script type="text/javascript">
            $151 = jQuery.noConflict();
            $151(function ($) { // In this scope $ === $151, or jQuery 1.5.1
              alert($().jquery);
              // $ !== jQuery.
              // $().jquery = 1.5.1
              // jQuery().jquery = 1.4.2
            });
            // outside the scope
            // $ === jQuery
            // $().jquery returns 1.4.2
    </script>
    

    How to use jQuery.noConflict();

    $.noConflict() returns a copy of jQuery, you can capture it a variable like so:

    var j = $.noConflict()

    HTML:

    <script type="text/javascript" src="jquery-1.4.2.min.js" ></script>
    <script type='text/javascript' src='jquery-1.5.1.min.js'></script>
    

    JavaScript:

    // jQuery === $
    //$().jquery === 1.5.1
    

    .

    jQ151 = $.noConflict();
    

    .

    // jQ151 !== $
    // jQ151().jquery === 1.5.1
    // $().jquery === 1.4.2
    

    in jQuery.ready(function() {.. or simply jQuery(function() {.. the first argument is a local copy of jQuery:

    <script type="text/javascript" src="jquery-1.4.2.min.js" ></script>
    <script type="text/javascript">
        jQuery(function($) {
            // in this scope $ refers to jQuery version 1.4.2
        });
    </script>
    <script type='text/javascript' src='jquery-1.5.1.min.js'></script>
    
    <script type="text/javascript">
        jQuery(function($) {
            // in this scope $ refers to jQuery version 1.5.1
        });
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say I have an facebook application running using the JS SDK. First user
Let's say you have a class called Customer, which contains the following fields: UserName
Let's say I have a dataset, which can be neatly classified using weka's J48
Let's say a user is visiting my app website for the first time, so
Let's say I have this string which I want to put in a multidimensional
Let's consider the following scenario: a function which can generate code colors from white
Let's say i have two tables in db: Car and Part. Car owns arbitrialy
Let's assume we have the following structure: index.php config.inc.php \ lib \ lib \
Let me start by telling you that I never used anything besides SVN and
Let’s say I have a number like 0x448 . In binary this is 0100

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.