You can pass arguments with

onDrop: doTheThing

if doTheThing is defined as

doTheThing: function(draggable, droppable)
{
        ...
}


Then when onDrop(arg1, arg2) gets called, it will work just fine. When
you assign a function to a variable, you get the function, which
includes it's entire signature. In fact, you can pass argument no matter
what. If you feel like pass an argument for every letter of the alphabet
to ANY function you can... of course the function may or may not have
code to handle them, but you can still pass as many as you like in
javascript.


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Jeremy Kitchen
Sent: Thursday, January 26, 2006 5:00 PM
To: [email protected]
Subject: Re: [Rails-spinoffs] Make all LI items draggable

On Wednesday 25 January 2006 11:34, Cam McVey wrote:
> Louis,
>
> You can do it that way, but you need to drop the brackets. So, your
code
> becomes:
>
> onDrop:doTheThing
>
> This also means you can't pass anything into the function.

but you can also do:
onDrop: function() { doTheThing(args); }

if you want to pass arguments

-Jeremy
-- 
Jeremy Kitchen ++ [EMAIL PROTECTED]

In the beginning was The Word and The Word was Content-type: text/plain
  -- The Word of Bob.

The information transmitted in this electronic mail is intended only for the
person or entity to which it is addressed and may contain confidential,
proprietary, and/or privileged material.  Any review, retransmission, 
dissemination or other use of, or taking of any action in reliance upon,
this information by persons or entities other than the intended recipient
is prohibited. If you received this in error, please contact the sender and
delete the material from all computers.

_______________________________________________
Rails-spinoffs mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

Reply via email to