I am familiar with this construct in jQuery:
$('#some-element').doSomethingJQueryDoes();
But I don't understand this construct:
$(function(){
..
});
It appears I am passing an anonymous function to jQuery but I am curious:
- When does this execute? From the code inside it appears to execute on document.ready
- Is there any way to give this function a NAME so that I can call it outside of events happening, outside of its scope?