Reputation: 4951
I have assigned jQuery.noConflict()
to $jq
:
var $jq = jQuery.noConflict();
Now I want to edit a jquery plugin to use $jq. There are a lot of codes in the following style:
(function($) { /* some code that uses $ */ })(jQuery)
Changing $
to $jq
doesn't solve the problem. What should I do?
Upvotes: 0
Views: 36
Reputation: 224886
You don't need to do anything. The $
is a variable local to the function that wraps the plugin; it's immediately assigned to jQuery
, as you can see after the function literal:
})(jQuery) // Immediately calls the wrapper function with jQuery being passed
// as the $ argument.
Upvotes: 3