Search code examples
javascriptjqueryconflict

Conflict jquery libs


is the following I have 2 scripts one playlist and other notifications in real time and uses this lib PlayList: http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js and the notification of this: http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js and when the lib is in the playlist code notifications not run and if I take wheel but I want the two working, how do I?


Solution

  • You can use both libraries, this is the way to call those libs.

    <script src='http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js'></script>
    <script> var jq110 = jQuery.noConflict(); </script>
    
    <script src='http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js'></script>
    <script> var jq142 = jQuery.noConflict();</script>
    

    So, when you are going to call the library you use jq110 instead the $ sign and for the notification script use jq142 instead the $ sign again.