Karl, using object literals seems to work:
var a =
{
foo: function()
{
}
}
function bar (a)
{
$(elem).click (a.foo)
}
bar (a)
Dave
Karl Rudd wrote:
>
> That should work. You'll need to show us code that is a little more
> specific.
>
> Karl Rudd
>
> On 12/12/06, dmoshal <[EMAIL PROTECTED]> wrote:
>>
>> Hi,
>> Firstly - wow, what an amazing piece of work - Kudos!
>> I've been more productive with jQuery in a day than I've been with YUI,
>> and
>> GWT in weeks.
>>
>> Question:
>>
>> how does one pass a function into jQuery, ie
>>
>> given: function foo(){}
>>
>> I want to assign it to the element's onclick handler:
>>
>> $(elem).click (foo)
>>
>> which doesn't seem to work?
>>
>> (note, in this case, I don't want to define foo inside .click (), but
>> just
>> pass it in)
>>
>> thx
>>
>> Dave
>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/passing-functions-tf2805241.html#a7826647
>> Sent from the JQuery mailing list archive at Nabble.com.
>>
>>
>> _______________________________________________
>> jQuery mailing list
>> [email protected]
>> http://jquery.com/discuss/
>>
>
> _______________________________________________
> jQuery mailing list
> [email protected]
> http://jquery.com/discuss/
>
>
--
View this message in context:
http://www.nabble.com/passing-functions-tf2805241.html#a7827026
Sent from the JQuery mailing list archive at Nabble.com.
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/