I want to chat with you on google talk,.
I love you,
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
Prototype: Core group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from
I want to chat with you on google talk,.
I love you,
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
Prototype: Core group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from
Hey folks,
Weighing in briefly (being hammered at work and at home, and not in
that fun way). Great stuff so far! Thoughts/opinions/questions:
1. IMHO, $$() should _always_ return a list/array/whatever, even if
there's only one element; it should never return the NodeWrapper
itself. Two
On Aug 21, 7:13 am, T.J. Crowder [EMAIL PROTECTED] wrote:
Hey folks,
Weighing in briefly (being hammered at work and at home, and not in
that fun way). Great stuff so far! Thoughts/opinions/questions:
1. IMHO, $$() should _always_ return a list/array/whatever, even if
there's only one
@T. J. Crowder take some time to look at the jQuery source, it might
help with the wrapper discussion.
I was not suggesting that $$() return a list in some cases and a
single item in others. I was saying that
getter/setter methods would execute on the first matched item.
In jQuery (jQuery
On Aug 21, 9:21 am, T.J. Crowder [EMAIL PROTECTED] wrote:
Hiya,
2. FWIW, it seems to me that calling an accessor on a list should
return a list of the accessor results for each list element. Always.
...
This is tricky : )
On one hand, having accessor act on all elements seems
@JDD:
Thanks. I understood your suggsetion about the accessors, I thought
I'd also (separately) seen a suggestion that $$() return a single
wrapped element when it only finds one, but I'm not immediately
finding what it was that made me thing that. Sounds like we're all on
the same page wrt
I like the wrapper tack (same way Ext does it). .raw doesn't sound intuitive
to me though. Why not just use .dom for the underlying element (also like
Ext)? Or .el? .raw just doesn't make for a beautiful API, IMHO :)
And no, don't make it a function call.
On Thu, Aug 21, 2008 at 10:41 AM, T.J.
I disagree on the list applying accessors to only the first element.
From an API perspective I just don't see that it makes sense. I'd
much rather see a first() method or property, or better yet (as I
suggested to kangax) an explicit means of saying give me the first
(and only the first)
This happens anytime one needs to reference an element without id:
$$('[name='+prop+']')[0]; // get element by name
$$('tbody tr:first-child')[0]; // get first row of a table
$$('img[src^=data:image]')[0]; // get image with specified src
attribute
Sure, that makes much more sense to me
On Aug 21, 10:44 am, John-David Dalton [EMAIL PROTECTED]
wrote:
@T. J. Crowder take some time to look at the jQuery source, it might
help with the wrapper discussion.
I was not suggesting that $$() return a list in some cases and a
single item in others. I was saying that
getter/setter
// if source is a method
$$(css).source() - equiv
$$(css)[0].source() - equiv
$$(css).first().source() - equiv
you could always cache it
var source = $$(css).source();
// an array of sources
$$(css).invoke('source'); // OR
$$(css).each($$.source); //notice static $$.source method
kangax wrote:
...
Ken,
I wanted to keep $W consistent with the rest of the library - be a
simple shortcut for creating a new instance of NodeWrapper. Just like `
$H` returns `new Hash` and $R returns `new ObjectRange`, $W should
probably return `new NodeWrapper`. $W is also responsible for
13 matches
Mail list logo