here are the third style

var test = new Frm('frm1',{method:'post',url:'testing.php'});

var test = new Frm('frm1','post','testing.php');

var test = new Frm({id:'frm1',method:'post',url:'testing.php'});

which style that the prototypejs developer suggest us to use??

On 11月8日, 上午10時53分, vtsuper <[EMAIL PROTECTED]> wrote:
> Dear all,
>
> any new ideas about this question????
>
> Victor
>
> On 11月7日, 上午12時53分, vtsuper <[EMAIL PROTECTED]> wrote:
>
>
>
> > yes...this is my question
> > "Or are you asking which style to use when you're defining your own
> > functions and classes? "
>
> > Both ways should be doing the same things...but what I want to know is
> > what is the prototypejs developer will suggest us to use.
>
> > On Nov 6, 8:52 pm, "T.J. Crowder" <[EMAIL PROTECTED]> wrote:
>
> > > 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- Hide quoted text -
>
> > > - Show quoted text -- 隱藏被引用文字 -
>
> > - 顯示被引用文字 -- 隱藏被引用文字 -
>
> - 顯示被引用文字 -
--~--~---------~--~----~------------~-------~--~----~
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 prototype-scriptaculous@googlegroups.com
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to