From what i understand, in jquery, when a method requires a function as an argument you can't just invoke a predefined function like this:
$('#target').click(myFunction());
...because "myFunction()" will be parsed and replaced with the value returned by the function...which is no longer a function.You have to put the entire function definition, in an anonymous function:
$('#target').click(function() {
alert('Handler for .click() called.');
});
...so, is there any way of just invoking the function where it's required as an argument?