3

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
asked Feb 19, 2015 at 21:33
6
  • Please don't answer, there are many duplicate .. [and yes, it passes a new "anonymous" function] Commented Feb 19, 2015 at 21:35
  • 2
    @user2864740 damn, was too slow to find a dup... Commented Feb 19, 2015 at 21:36
  • I can't find this exact scenario Commented 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. Commented Feb 19, 2015 at 21:37
  • 1
    @MikeLyons Found some: stackoverflow.com/questions/6454631/… , stackoverflow.com/questions/27829847/… , stackoverflow.com/questions/24226886/… Commented Feb 19, 2015 at 21:39

1 Answer 1

2

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
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.