var $j = jQuery.noConflict();
//Now you can use '$j' just like '$'
$j("div").hide();
An alternate technique is to wrap jQuery calls in an anonymous function and pass jQuery in as a parameter. Then you can use whatever alias you want, including the ‘$’. This is especially useful for plugin authoring
(function($){
$(document).ready(function(){
//You can use normal jQuery syntax here
});
})(jQuery);
No comments:
Post a Comment