This is because jQuery.noConflict() "exempts" the "$" value from the jQuery associated value. Normally in code, you can use $ as a replacement for "jQuery". If you use noConflict() , you can no longer do this, so you need to replace each "$" with "jQuery" ;,
Many JavaScript libraries use $ as the name of a function or variable, just as jQuery does. In the case of jQuery, $ is just an alias for jQuery, so all functions are available without using $. If we need to use another JavaScript library with jQuery, we can return the $ control back to another library with a call to $ .noConflict ():
you can also create a completely new alias to use
var myJqueryAlias = jQuery.noConflict(); myJqueryAlias(document).ready(function(){ myJqueryAlias("#insideTable > tbody > tr:odd").addClass("odd"); myJqueryAlias("#insideTable > tbody > tr:not(.odd)").hide(); myJqueryAlias("#insideTable > tbody > tr:odd").show(); myJqueryAlias("#insideTable > tbody > tr.odd").click(function(){ myJqueryAlias(this).next().toggle(); myJqueryAlias(this).find(".arrow").toggleClass("up"); }); });
Nicola Peluchetti Jul 19 '11 at 11:26 2011-07-19 11:26
source share