View Single Post
11-14-2010, 10:25 PM
#1
Mizko is offline Mizko
Status: I'm new around here
Join date: Oct 2007
Location: Australia
Expertise:
Software:
 
Posts: 1
iTrader: 0 / 0%
 

Mizko is on a distinguished road

Send a message via MSN to Mizko

  Old  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.