As jQuery API says so,
If for some reason two versions of jQuery are loaded (which is not recommended by jQuery API),
calling $.noConflict( true ) from the second version will return the globally scoped jQuery variables to those of the first version.
<script src="other_lib.js"></script>
<script src="jquery.js"></script>
<script>
$.noConflict();
// Code that uses other library's $ can follow here.
</script>
This technique is especially effective in conjunction with the .ready() method's ability to alias the jQuery object, as within callback passed to .ready() you can use $ if you wish without fear of conflicts later:
<script src="other_lib.js"></script>
<script src="jquery.js"></script>
<script>
$.noConflict();
jQuery( document ).ready(function( $ ) {
// Code that uses jQuery's $ can follow here.
});
// Code that uses other library's $ can follow here.
</script>
In one project I've used it as
var j = jQuery.noConflict();
// Do something with jQuery
j( "div p" ).hide();
Also like this
jQuery.noConflict();
(function( $ ) {
$(function() {
// More code using $ as alias to jQuery
});
})(jQuery);
I hope this helps.