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?
Asked
Active
Viewed 2,709 times
2
-
http://stackoverflow.com/a/15383186/1238887 -- this should answer your question. – ahren Mar 13 '13 at 10:55
-
Please add some code, or error message you get. – Eugene Pavlov Mar 13 '13 at 10:56
-
I don't have error message, but the animations don't work well – Alaa Mar 13 '13 at 10:57
-
So how did you come to the conclusion that it's a conflict? – ahren Mar 13 '13 at 10:59
1 Answers
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