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
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
> 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
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)
@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
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
--~--~
> 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
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