On a recent project I had to integrate a front end I built into another environment that had some restrictions. I didn't have full control over the page. It was loading jQuery 1.4.2 and had many elements which required this version. My front end, however, was written for jQuery 1.10.2. It was going to be a nightmare to rewrite all this code the way things were done over 3 years ago.

I had to find a way to run both versions of jQuery side-by-side without the page blowing up. At first I was stumped, but then I enlisted the help of my good friend and JavaScript genius, [AJ ONeal][1].

The resulting solution looks a little weird, but it works. It allowed me to set up a page where two very different versions of jQuery are running side by side. It makes use of [jQuery's noConflict mode][2] and a good understanding of how variable reference works in JavaScript. Here's how it looks.

And we can test that both versions are working. We should have safe access to both versions from the console and any scripts we add to the page.