javascript - How to understand this jquery function -


this question has answer here:

what mean?:

 (function($){    })(jquery); 

and reason use it? thanks.

you creating new scope in javascript using function (as {} not create new scope). calling function , capturing jquery outer scope , make available inside variable $


Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -