passing variables into a function
there are two ways a fucntion can be called in responce to an event
$(this).click(function(){})
and
$(this).click(sam())
function sam() {}
using the second one if i want to give it the text string "ginger" as a variable i would do this
var text = "ginger";
$(this).click(sam(text))
function sam("varone") {}
How would i do this when using the first method of calling a function?
UPDATE
the second example does not work if i try to pass in any variables, it has to be
$(this).click(sam);
not
$(this).click(sam(variable))
or
$(this).click(sam())
so my question is now how do i pass a variable to a function with both methods