I\'m new to jQuery and am bit confused about the use (or not) of parentheses with a callback function. Say I have a function:
function cb() {
// do somethin
Is it to do with when the cb function is executed?
Essentially, yes, though the difference does run a little deeper than that.
cb
is a reference of sorts to the function. You're passing the function along as a parameter to be invoked somewhere down the line.
cb()
is a function call; the function will be invoked, and the result passed as an argument to .hide
.