jQuery function confusion
Ok as i've been going through this book i'm learning about basic functions.
I know that this is the basic format for a function.
function functionName() {
$("p").fadeOut("slow");
}
Then you'll have a button to call it out.
But i'm reading about Creating new HTML Elements and in the explample, why is the function set ou tlike this.
$(function()
{
$("<p>Test</p>")
.insertAfter("#first");
});
Just wondering, what is with the $function() could someone please explain, thanks.
|