I probably formulated myself badly, I wanted to be able to add stuff,
to something that you can do each() with :)
For instance, the lovely $$()
push worked just as advertised, sorry I didn't try it out myself
sooner. *slightly ashamed*
Andreas
On Jun 28, 2006, at 16:48 , Martin Ström wrote:
Are you trying to use document.getElementsByTagName? Then you're
missing the document.-part (or whatever node you want to use)
this should work fine:
var first = $A(document.getElementsByTagName("td")).push("...");
As for extending an enumarable object (in this case an array)
Object.extend(Array.prototype, {
PUSH: function(elm) {
// code
}
})
Ciao
Martin
On 6/28/06, Andreas Wahlin <[EMAIL PROTECTED]> wrote:
This might seem like a really daft question, but I couldn't find an
answer anywhere. How do you add something to an enumerable object?
Something like
var first = $A(getElementsByTagName('td'));
var second = $A(getElementsByTagName('tr'));
first.PUSH(second);
where the PUSH is something unknown.
am i supposed to use inject here in some way?
Andreas
_______________________________________________
Rails-spinoffs mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
_______________________________________________
Rails-spinoffs mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
_______________________________________________
Rails-spinoffs mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs