What does the below line mean? It passes function($) as a parameter into jQuery?
jQuery(function ($) {
// ...
});
user2864740
62.5k15 gold badges159 silver badges234 bronze badges
-
Please don't answer, there are many duplicate .. [and yes, it passes a new "anonymous" function]user2864740– user28647402015年02月19日 21:35:17 +00:00Commented Feb 19, 2015 at 21:35
-
2@user2864740 damn, was too slow to find a dup...Karl-André Gagnon– Karl-André Gagnon2015年02月19日 21:36:38 +00:00Commented Feb 19, 2015 at 21:36
-
I can't find this exact scenarioAxar– Axar2015年02月19日 21:36:47 +00:00Commented Feb 19, 2015 at 21:36
-
1@Karl-AndréGagnon Beat me though! I know there are exact duplicates ("what does this idiomatic use of $.ready mean", eg.) but kept finding higher-level questions.user2864740– user28647402015年02月19日 21:37:08 +00:00Commented Feb 19, 2015 at 21:37
-
1@MikeLyons Found some: stackoverflow.com/questions/6454631/… , stackoverflow.com/questions/27829847/… , stackoverflow.com/questions/24226886/…user2864740– user28647402015年02月19日 21:39:09 +00:00Commented Feb 19, 2015 at 21:39
1 Answer 1
It means, "treat this $ as if I were calling jQuery() when I use $() anywhere inside this anonymous function."
Jquery documentation: http://learn.jquery.com/using-jquery-core/
answered Feb 19, 2015 at 21:36
Mike Lyons
1,7942 gold badges21 silver badges35 bronze badges
Sign up to request clarification or add additional context in comments.
Comments
lang-js