javascriptjqueryjquery-1.5jquery-1.4

How do I use two different versions of jQuery side by side?


I'm writing a wrapper for Yahoo Web Analytics at work. My wrapper has jQuery 1.5.3 built-in, while the page where I'm installing the wrapper uses jQuery 1.4.3. When I include my wrapper, their site fails, due to what I'm guessing is the updated Ajax functions in jQuery 1.5.3.

Is there any way I can include jQuery without overwriting the previously included jQuery scripts?


Them upgrading their page is unfortunately not an option. Neither is downgrading our tracking script.


Solution

  • var $yournamespece = jQuery.noConflict(true);
    // now use $yournamespace instead of $
    $yournamespace('selector')
    

    Though I'm curious as to what your script uses that is not compatible with their version...1.5 hasn't really been out all that long