0

I have to jquery versions loaded in our website jquery A and jquery B for example. A is came from another server which i do not have control. B is the jquery version we have control, but once the A has been activated or loaded it conflicts to the B. The existing lightboxes were misaligned when A is loaded. A and B must be loaded. My question is how can I maintain both jquery versions without conflicting both?

I have research jquery noConlict() function which create a new selector so that it will not affect the other jquery library, my problem when I use this is I am not allowed to change the default '$()' selector.

Is there another way of doing this by not creating a new jquery selector? because we have many js codes and it is a bad idea to change all $() to new selector. Thanks.

  • 1
    There was the similar question: http://stackoverflow.com/questions/1566595/can-i-use-multiple-versions-of-jquery-on-the-same-page – IonDen Jul 13 '15 at 15:33
  • 1
    IonDen pointed to the correct answer. There's also a good hint in the comments. Wrap your code into a self invoking function too use the version you need in $ like you are used to. e.g. (function($) { /*your code here*/ })(jquery_x_x_x); – optimisticupdate Jul 13 '15 at 15:41

0 Answers0