EDIT: I THOUGHT The jQuery source I was looking at did something like this:
(function(){
var bunchOfVariables = 7;
jQuery = " .....";
//....
});
I was wrong about that. Ignore this question.
I don't understand what that does. Can someone please explain it?
This is the very first line in jQuery-1.3.2.js.
It appears to define an anonymous function, and NOT execute it. Where does the function go? How does it get run?
If I use code like that in a test script, it never gets called. On the other hand, if I follow it with open-close paren, then it gets called :
// never gets called
(function(){
say("hello");
});
// gets called
(function(){
say("buon giorno");
})();