0

I have a page with js source. I have to include two different jquery sources. If i take out one the countdown clock doesn't work. how i work with js conflit ?

<script type="text/javascript" src="files/js/jquery-1.3.1.min.js"></script>
<script type="text/javascript" src="files/js/jquery.scrollTo.js"></script>
<script type="text/javascript" src="files/js/kivi.js"></script>
        <script type="text/javascript" src="files/js/jquery.leanModal.min.js"></script>
        <script type="text/javascript">
            $(function() {
                $('a[rel*=leanModal]').leanModal({ top : 200, closeButton: ".modal_close" });       
            });
        </script>
Frhay
  • 424
  • 2
  • 16
DMS
  • 49
  • 8
  • What if you take out the other one? – 11684 Feb 13 '13 at 13:44
  • possible duplicate of [Can I use multiple versions of jQuery on the same page?](http://stackoverflow.com/questions/1566595/can-i-use-multiple-versions-of-jquery-on-the-same-page) – epascarello Feb 13 '13 at 13:46

1 Answers1

1

I think you should better find out how to fix the contdown clock instead of loading 2 versions of jquery on the page.

There is that noconflict method but i'm sure the plugin doesn't do it that way. You can edit the source of the plugin, wrap it in an annonymous self executing function that takes one parameter

(function($) { 
 // your plugin code here
})(JQ);

where JQ is the non conflict name you get from whatever version of jquery this plugin requires.

So safest way is to fix the clock plugin

TheBrain
  • 5,528
  • 2
  • 25
  • 26