jQuery - Avoiding conflicts


jQuery is just a library, developed by John Resig as its key developer. Someone else may also come up with his own library as did John Resig. The two can co exist as long as they use different names for calling the function. jQuery uses $ and the jquery as the function name. It is highly unlikely that jquery will be used as a function name, but there is a good chance that $ sign is used as the alias for the function name in the other library as well. If that is the case, it is possible to return the control of $ back to other library with $.noCOnflict().

You can use the following prototype in you need to return the control.


<script type="text/javascript" src="other_lib.js"></script>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
  $.noConflict();
  // Other library code that uses  $ can start here. .
</script>