user16948
user16948

Reputation: 4951

Editing a jQuery plugin for matching different jQuery version

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

Answers (1)

Ry-
Ry-

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

Related Questions