[thelist] JS: assigning a function to an object question

Tom Dell'Aringa pixelmech at yahoo.com
Sat Aug 30 00:16:52 CDT 2003


--- Kelly Hallman <khallman at wrack.org> wrote:
> On Fri, 29 Aug 2003, Tom Dell'Aringa wrote:
> > Speaking of unusual questions... I'm assigning a function to an
> object:
> > 
> > img.onclick = functionA;
> > function functionA() { blah }
> > 
> > Problem: I need to send 2 parameters to this function.
> 
> Use a lambda function, which is called a function literal in
> Javascript:
> 
> img.onclick = function() { functionA(p1,p2); };

Ahhh right! Excellent and thanks! Now does this have anything to do
with lambda lamda lamda of Revenge of the Nerds? ...(sorry, its
late)...

Tom

=====
http://www.pixelmech.com/ :: Web Development Services
http://www.DMXzone.com/ :: Premium Content Author / JavaScript / Every Friday!
http://www.maccaws.com/ :: Group Leader
[Making A Commercial Case for Adopting Web Standards]

"That's not art, that's just annoying." -- Squidward


More information about the thelist mailing list