Any chance someone could elaborate on what George explained? It sort of makes sense to me, but I'm still a bit lost. What would I do if a page I'm working on already has Prototype and JQuery 1.1.4 (loaded with noConflict()), and I wanted to then add JQuery 1.2.1 and some plugins? Is that even possible or should I just learn how to use 1.1.4 (which is being loaded because of a few Wordpress plugins)? I'm new to JQuery so I've been learning the latest build. Is it very different from 1.1.4? Sorry for the wide variety of questions.
Any help or knowledge would be greatly appreciated. -Nicholas On Oct 9, 9:29 am, George <[EMAIL PROTECTED]> wrote: > After looking at the code it seems quite straight-forward. Someone > correct me if I've got the wrong end of the stick. > > Summary: The first version you include will get reinstated, the second > version getting blown away. > > How it works: When you include jQuery, it makes a copy of the window.$ > and window.jQuery variables and puts them into _$ and _jQuery > (variables inside jQuery itself) respectively. So if there's already a > copy of jQuery included on the page (call it v1) and you go include > your second copy (call it v2), v1 will get 'backed up' into the _$ and > _jQuery variables inside v2 and the second copy you include will go > into window.$ and window.jQuery. At this point, if you use the $ > function or the jQuery object, you'll be using v2. When you call > jQuery.noConflict(true), it will run against v2 because that's what's > in window.jQuery and it'll take the variables in _$ and _jQuery (which > are v1), put them back into window.$ and window.jQuery, and return you > a copy of v2 for you to put into a variable (called jQv2 for example). > > At this point, window.$ and window.jQuery will be v1 and jQv2 will be > v2. So if you want to use v1, you carry on using $(...) or > jQuery.whatever(...) and if you want to use v2, you use > jQv2('#someId') or jQv2.whatever(...). > > Hope this makes sense. > > George. > > On Oct 4, 12:27 am, "Glen Lipka" <[EMAIL PROTECTED]> wrote: > > > We are making a jQuery+stuff script that will go on lots of random pages > > with unknown libraries. > > Some of those pages will have jQuery. (Variousversions) > > > If I am including our script last; what is the best way to make sure our > > script doesn't interfere with any of the existing page, including old > >versionsof jQuery. > > > Solution #1: We renamed jQuery in our script everywhere to be veryjQuery. > > Solution #2: ??? > > > Note: Solution #1 solved the problem, but feels invasive. Is there a > > noconflict() way to do this? > > > Glen