var _$ = window.$; var jQuery = function(){}; jQuery.extend({ noConflict: function(deep){ if (window.$ === jQuery) { window.$ = _$; } if (deep && window.jQuery === jQuery){ window.jQuery = _jQuery; } return jQuery; } });
Load jquery and other libraries are also used after $,
var $ J = jQuery.noConflict (); // define a new name $ J ( function () {});
If you want to continue to use $ in jQuery, the only need $ as a parameter,
jQuery.noConflict(); jQuery(function($){ $('div').click(function(){ }); });