Hi Victor,
It depends entirely on what you're calling and how it's expecting to
receive them. When calling an element's observe() method, for
instance, this works:
myelement.observe('click', function(evt) { /* ... */ });
...but this doesn't:
myelement.observe({
eventName: 'click',
handler: function(evt) { /* ... */ }
});
...because observe() doesn't expect to receive an object for its
paramters. But some other things, such as Ajax.Request, expect to
receive some of their information that way. It's all down to the
thing you're dealing with.
Or are you asking which style to use when you're defining your own
functions and classes?
HTH,
--
T.J. Crowder
tj / crowder software / com
On Nov 6, 11:38 am, vtsuper <[EMAIL PROTECTED]> wrote:
> Dear all,
>
> I have a small question. when should I pass parameter by variables?
> var test = new Frm('frm1','post','testing.php');
>
> and when should I pass parameter by object?
> var test = new Frm({id:'frm1',method:'post',url:'testing.php'});
>
> Regards,
> Victor
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Prototype & script.aculo.us" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---