[Proto-Scripty] Re: how to optimize?

2008-10-23 Thread T.J. Crowder
Hey Juriy, > I respect your style, T.J., but things like "return undefined" always > throw me off as being a bit redundant : ) Functions return undefined > implicitly when nothing is specified, so why not take advantage of > that? I take your point, but it's a clarity thing. My background is ov

[Proto-Scripty] Re: how to optimize?

2008-10-23 Thread kangax
On Oct 22, 5:42 am, "T.J. Crowder" <[EMAIL PROTECTED]> wrote: > @All: > > You know how you plan to send a really brief, simple reply and things > just get out of hand?  Apologies for the long post... > > @RobG: > > > doSomething($('elID')) > > I think he means using Prototype's element extensions

[Proto-Scripty] Re: how to optimize?

2008-10-23 Thread T.J. Crowder
> Wouldn't it be possible to have the better of the two worlds with > something like this: All sorts of options, yes. :-) On reflection, I think the best course would be to have a FakeElement class that has all of the properties and methods of an extended element, but doesn't actually have anyth

[Proto-Scripty] Re: how to optimize?

2008-10-23 Thread Eric
Wouldn't it be possible to have the better of the two worlds with something like this: SafeElement=Class.create(); for (e in Element.Methods) { SafeElement[e]=Element.Methods[e].wrap(function(originalFunction,element) { var args; element = $(element); if (!element)

[Proto-Scripty] Re: how to optimize?

2008-10-22 Thread T.J. Crowder
@All: You know how you plan to send a really brief, simple reply and things just get out of hand? Apologies for the long post... @RobG: > doSomething($('elID')) I think he means using Prototype's element extensions (though I could be mistaken). Naturally if you like, you can code your own me

[Proto-Scripty] Re: how to optimize?

2008-10-21 Thread RobG
On Oct 22, 5:31 am, buda <[EMAIL PROTECTED]> wrote: > Often I need to wtite somthing like : > > var el = $('elid'); > if (el){ >   el.doSomthing(); > > } > > Is there a way to write in one-line instruction on prototype? > JQuery do has such syntax doSomething($('elID')) -- Rob --~--~

[Proto-Scripty] Re: how to optimize?

2008-10-21 Thread Justin Perkins
> Is there a way to write in one-line instruction on prototype? $$('#elid').invoke('doSomething'); --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send ema

[Proto-Scripty] Re: how to optimize?

2008-10-21 Thread buda
thanks! On 21 окт, 22:33, "Justin Perkins" <[EMAIL PROTECTED]> wrote: > > Is there a way to write in one-line instruction on prototype? > > $$('#elid').invoke('doSomething'); --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google G