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

mod rewrite - Using "?" when rewriting the URL -

.htaccess: Transfer name to index.php if not directory public -

Admob integration with pygame in android -