2

I am working on C#.net project, and I use multiple javascript libraries for menu and image sliders and other, but there is a conflict appeared, how can I avoid that?

Alaa
  • 207
  • 2
  • 7
  • 19

1 Answers1

1

Right after the load of the jQuery library you call the $.noConflict(); and then all your calls to jQuery are made using the jQuery keyword. Example from the jQuery site:

<script type="text/javascript" src="other_lib.js"></script>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
  $.noConflict();
  jQuery(document).ready(function($) {
    // Code that uses jQuery's $ can follow here.
  });
  // Code that uses other library's $ can follow here.
</script>
Aristos
  • 66,005
  • 16
  • 114
  • 150
  • but I don't have JQuery code in my .aspx page, all my JQuery code in external .js file, so what I can do? – Alaa Mar 13 '13 at 11:53
  • @Alaa Do the same, load the jQuery, right after the rest of your jQuery libs, then call the noConfict. – Aristos Mar 13 '13 at 11:55