this sounds like:
$('some_element_id').appendChild( new Element(tagName, options) );
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
Prototype: Core group.
To post to this group, send email to
Hi guys,
I was looking through some of my old source code and noticed that I
added a modified Object.extend method.
Apparently the normal for-in loop used in the Object.extend guts
ignores methods named 'toString'.
I fixed this:
/* * * * * * * * * * * * * * * * * * *
*
*Prototype
On 5/30/07, jdalton [EMAIL PROTECTED] wrote:
I was looking through some of my old source code and noticed that I
added a modified Object.extend method.
Apparently the normal for-in loop used in the Object.extend guts
ignores methods named 'toString'.
Yeah, toString is non-iterable in JS.
Then this opens up the whole can of worms of, well if we're adding explicit
support for this non-iterable property, why not others, and the list could
grow along with any resulting code.
If anything, I'd add support for passing an array of member names to check
for at extend-time (thus making it
Honestly, I don't care about the core dev teams inner soul searching
on what they want to do.
I just merely posted this to point out that the for-loop doesn't
iterate over the method 'toString'.
I am happy with my solution and if it's left up to the Devs to fix on
an 'as needed' basis I am
On 5/30/07, timcharper [EMAIL PROTECTED] wrote:
What do you think if we added a shortcut method to
an instantiated method capable of building and appending a new element
to it in one swoop?
So you're proposing a wrapper around new Element(); appendChild()? It's
useful, yeah... But is build
My comment was not intended to be malicious, but rather sarcastic.
Tone and inflection don't translate well to text.
As always keep up the great work! 8P
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
Prototype:
It does not ignore based on name -- if you define a property named 'toString'
as a function (or some other object) it will be included in the for-in loop.
But the for-in loop ignores 'build-in' properties like 'toString' on Object
etc. and 'length' on Array.
-Tobias
-Oprindelig
On 5/30/07, jdalton [EMAIL PROTECTED] wrote:
@Tobias, I dont know if that is true.
This works:
foo = Object.extend({}, { toString:function(){ return 'BOO!' } })
foo.toString()
This doesn't:
Dummy = Class.create()
Object.extend(Dummy.prototype, { toString:function(){ return 'BOO!' } })
new