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 513921
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T07:28:16+00:00 2026-05-13T07:28:16+00:00

I’m writing a little JavaScript tool for myself that I plan on making available

  • 0

I’m writing a little JavaScript tool for myself that I plan on making available to other people and it uses jQuery. My dream for this little utility is for people to be able to include a single .js file from a remote source and, when that file is loaded, have it check to see if jQuery has already been included and, if it has, make sure it’s a recent enough version so as to be compatible with what my code needs to do. Some pseudocode which may explain my issue more clearly (this code would appear at the top of the single .js file I mentioned earlier):

if jQuery is loaded {
    if version is less than (say) 1.3 {
        // load latest version of jQuery 
    }
} else {
    // load latest version of jQuery
}

// and do the jQuery.noConflict() 
// dance to avoid trampling any other libraries, etc. that the 
// user may be utilizing.

// The rest of my code lives here, happy in the knowledge that it's running in
// isolation from the rest of the JS that the page knows about.

My question, distilled into three friendly parts:

  1. Is it possible to load two separate versions of jQuery without them crapping all over each other?
  2. Can I stop the execution of my JS code while jQuery is loaded, then proceed?
  3. Is it possible to use noConflict() as I’m describing it? Or should I just call everything using jQuery() and not bother with it?

The overarching idea here is that any old user could grab a small snippet of HTML and drop it into their site/blog/whatever and have it Just Work™. And since many modern publishing platforms now ship with jQuery, I can’t just quietly assume that it’s not running and include it.

Thanks for your time, and please let me know if any part of this isn’t clear or if I can provide additional context/detail to make your providing a response easier.

  • 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-05-13T07:28:16+00:00Added an answer on May 13, 2026 at 7:28 am
    function doMyStuff(jQueryJustForThisFn) {
        // do jQuery stuff!
        jQueryJustForThisFn('div').addClass('wow');
    }
    
    function check() {
        return window.jQuery && jQuery.fn && /^1\.[3-9]/.test(jQuery.fn.jquery);
    }
    
    if ( check() ) {
    
        doMyStuff( jQuery );
    
    } else {
    
        var script = document.createElement('script'),
    
            timer = setInterval(function(){
                if ( check() ) {
                    clearInterval(timer);
                    document.body.removeChild(script);
                    doMyStuff( jQuery.noConflict(true) );
                }
            }, 30);
    
        script.src = 'http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js';
    
        document.body.insertBefore( script, document.body.firstChild );
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 419k
  • Answers 419k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer For a simple discrete distribution, you can write a sampler… May 15, 2026 at 10:21 am
  • Editorial Team
    Editorial Team added an answer Assuming that you want Ctrl+C, Ctrl+V type of functionality; you… May 15, 2026 at 10:21 am
  • Editorial Team
    Editorial Team added an answer This is very common. As long as you handle the… May 15, 2026 at 10:21 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.