<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: appendChild is not a Function</title>
	<atom:link href="http://erik.eae.net/archives/2006/04/27/17.50.15/feed/" rel="self" type="application/rss+xml" />
	<link>http://erik.eae.net/archives/2006/04/27/17.50.15/</link>
	<description>The Weblog of Erik Arvidsson</description>
	<pubDate>Thu, 21 Aug 2008 23:19:06 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
		<item>
		<title>By: çeviri</title>
		<link>http://erik.eae.net/archives/2006/04/27/17.50.15/#comment-102572</link>
		<dc:creator>çeviri</dc:creator>
		<pubDate>Mon, 08 Oct 2007 14:51:28 +0000</pubDate>
		<guid isPermaLink="false">http://erik.eae.net/archives/2006/04/27/17.50.15/#comment-102572</guid>
		<description>All objects, DOM and other browser objects, inherits from Object in Mozilla...</description>
		<content:encoded><![CDATA[<p>All objects, DOM and other browser objects, inherits from Object in Mozilla&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ingilizce tercume</title>
		<link>http://erik.eae.net/archives/2006/04/27/17.50.15/#comment-102269</link>
		<dc:creator>ingilizce tercume</dc:creator>
		<pubDate>Sat, 21 Jul 2007 23:54:20 +0000</pubDate>
		<guid isPermaLink="false">http://erik.eae.net/archives/2006/04/27/17.50.15/#comment-102269</guid>
		<description>I’m still trying to find a practical use for IE’s implementation of toString on COM’s...</description>
		<content:encoded><![CDATA[<p>I’m still trying to find a practical use for IE’s implementation of toString on COM’s&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: splintor</title>
		<link>http://erik.eae.net/archives/2006/04/27/17.50.15/#comment-17275</link>
		<dc:creator>splintor</dc:creator>
		<pubDate>Wed, 14 Jun 2006 08:37:33 +0000</pubDate>
		<guid isPermaLink="false">http://erik.eae.net/archives/2006/04/27/17.50.15/#comment-17275</guid>
		<description>"it looks like native methods don't get listed when enumerating the members of an object"
from http://blog.monstuff.com/archives/000287.html</description>
		<content:encoded><![CDATA[<p>&#8220;it looks like native methods don&#8217;t get listed when enumerating the members of an object&#8221;<br />
from <a href="http://blog.monstuff.com/archives/000287.html" rel="nofollow">http://blog.monstuff.com/archives/000287.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Erik Arvidsson</title>
		<link>http://erik.eae.net/archives/2006/04/27/17.50.15/#comment-13333</link>
		<dc:creator>Erik Arvidsson</dc:creator>
		<pubDate>Wed, 10 May 2006 02:12:39 +0000</pubDate>
		<guid isPermaLink="false">http://erik.eae.net/archives/2006/04/27/17.50.15/#comment-13333</guid>
		<description>A couple of hours ago I went through the painful process o filing exactly this bug to MSFT. The problem as I see it is that they do not check the DontEnum flag on the right object (if any proto has it, the property is not enumerated). The same problem occurs if you create a new String and changes replace for example</description>
		<content:encoded><![CDATA[<p>A couple of hours ago I went through the painful process o filing exactly this bug to MSFT. The problem as I see it is that they do not check the DontEnum flag on the right object (if any proto has it, the property is not enumerated). The same problem occurs if you create a new String and changes replace for example</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Garrett Smith</title>
		<link>http://erik.eae.net/archives/2006/04/27/17.50.15/#comment-13330</link>
		<dc:creator>Garrett Smith</dc:creator>
		<pubDate>Tue, 09 May 2006 23:00:38 +0000</pubDate>
		<guid isPermaLink="false">http://erik.eae.net/archives/2006/04/27/17.50.15/#comment-13330</guid>
		<description>alert(document.body.toString())

I'm still trying to find a practical use for IE's implementation of toString on COM's...</description>
		<content:encoded><![CDATA[<p>alert(document.body.toString())</p>
<p>I&#8217;m still trying to find a practical use for IE&#8217;s implementation of toString on COM&#8217;s&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Garrett Smith</title>
		<link>http://erik.eae.net/archives/2006/04/27/17.50.15/#comment-13329</link>
		<dc:creator>Garrett Smith</dc:creator>
		<pubDate>Tue, 09 May 2006 22:57:55 +0000</pubDate>
		<guid isPermaLink="false">http://erik.eae.net/archives/2006/04/27/17.50.15/#comment-13329</guid>
		<description>In IE, no JS object properties/methods are not available on COM objects. 

valueOf, hasOwnProperty, et c. Not avaliable.

Interestingly, toString is available. 

What is even more interesting: acts like a "DontEnum" property, so for(prop in node) , "toString" won't be exposed. 

IE doesn't actually implement the internal "DontEnum" property correctly (at least in my interpretation of the ECMAScript Spec.

so

Carp = {
    "toString" : function(){ return "Carp, carp, carp"; }
}

for(var prop in Carp)
    alert(Carp[prop]);
}

IE thinks that the "toString" defined in Carp has a DontEnum property on it, and this is what I think is incorrect. I think IE is iterating through a list of strings ("toString", "valueOf") and skips any prop that matches the string.</description>
		<content:encoded><![CDATA[<p>In IE, no JS object properties/methods are not available on COM objects. </p>
<p>valueOf, hasOwnProperty, et c. Not avaliable.</p>
<p>Interestingly, toString is available. </p>
<p>What is even more interesting: acts like a &#8220;DontEnum&#8221; property, so for(prop in node) , &#8220;toString&#8221; won&#8217;t be exposed. </p>
<p>IE doesn&#8217;t actually implement the internal &#8220;DontEnum&#8221; property correctly (at least in my interpretation of the ECMAScript Spec.</p>
<p>so</p>
<p>Carp = {<br />
    &#8220;toString&#8221; : function(){ return &#8220;Carp, carp, carp&#8221;; }<br />
}</p>
<p>for(var prop in Carp)<br />
    alert(Carp[prop]);<br />
}</p>
<p>IE thinks that the &#8220;toString&#8221; defined in Carp has a DontEnum property on it, and this is what I think is incorrect. I think IE is iterating through a list of strings (&#8221;toString&#8221;, &#8220;valueOf&#8221;) and skips any prop that matches the string.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Erik Arvidsson</title>
		<link>http://erik.eae.net/archives/2006/04/27/17.50.15/#comment-13235</link>
		<dc:creator>Erik Arvidsson</dc:creator>
		<pubDate>Thu, 04 May 2006 00:21:55 +0000</pubDate>
		<guid isPermaLink="false">http://erik.eae.net/archives/2006/04/27/17.50.15/#comment-13235</guid>
		<description>All objects, DOM and other browser objects, inherits from Object in Mozilla.</description>
		<content:encoded><![CDATA[<p>All objects, DOM and other browser objects, inherits from Object in Mozilla.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nicholas</title>
		<link>http://erik.eae.net/archives/2006/04/27/17.50.15/#comment-13232</link>
		<dc:creator>Nicholas</dc:creator>
		<pubDate>Wed, 03 May 2006 20:28:05 +0000</pubDate>
		<guid isPermaLink="false">http://erik.eae.net/archives/2006/04/27/17.50.15/#comment-13232</guid>
		<description>It has always bugged me that DOM and BOM elements don't derive from the native JavaScript objects. Why IE chose to implement DOM methods as something other than JS functions is completely beyond me. And while we're on the subject, why can't DOM elements inherit from Object? Maybe someday.</description>
		<content:encoded><![CDATA[<p>It has always bugged me that DOM and BOM elements don&#8217;t derive from the native JavaScript objects. Why IE chose to implement DOM methods as something other than JS functions is completely beyond me. And while we&#8217;re on the subject, why can&#8217;t DOM elements inherit from Object? Maybe someday.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Erik Arvidsson</title>
		<link>http://erik.eae.net/archives/2006/04/27/17.50.15/#comment-13228</link>
		<dc:creator>Erik Arvidsson</dc:creator>
		<pubDate>Wed, 03 May 2006 16:54:40 +0000</pubDate>
		<guid isPermaLink="false">http://erik.eae.net/archives/2006/04/27/17.50.15/#comment-13228</guid>
		<description>Steve: Yes, that is irrelevant... text node in document was just an example... badly chosen... It would have been better to use document.body.

I'll change the example.</description>
		<content:encoded><![CDATA[<p>Steve: Yes, that is irrelevant&#8230; text node in document was just an example&#8230; badly chosen&#8230; It would have been better to use document.body.</p>
<p>I&#8217;ll change the example.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve</title>
		<link>http://erik.eae.net/archives/2006/04/27/17.50.15/#comment-13223</link>
		<dc:creator>Steve</dc:creator>
		<pubDate>Wed, 03 May 2006 13:29:05 +0000</pubDate>
		<guid isPermaLink="false">http://erik.eae.net/archives/2006/04/27/17.50.15/#comment-13223</guid>
		<description>Erik,

This may be irelivant here, but if I recall correctly... the structure of appendChild is:

appendChild( arg_0 );

(e.g. arity == 1)

That, coupled with the fact that appendChild is a "method" on a DOM node, this scenario is a bit whacky.

Finally, you can't add a text node, to {document}... if you wanted to, you could add it to say... document.getElementsByTagName('body')[0]

E.g.

document.getElementsByTagName('body')[0].appendChild(document.createTextNode('Huh?'));

Now, that all said, the following code, as you mentioned, still doesn't work. ;-)

var f = document.getElementsByTagName('body')[0].appendChild;
alert(f); //Native Function...
alert(f.arity); //1 (only 1 argument expected)...
f.call( document.createTextNode('Huh?') );

Cheers,
Steve</description>
		<content:encoded><![CDATA[<p>Erik,</p>
<p>This may be irelivant here, but if I recall correctly&#8230; the structure of appendChild is:</p>
<p>appendChild( arg_0 );</p>
<p>(e.g. arity == 1)</p>
<p>That, coupled with the fact that appendChild is a &#8220;method&#8221; on a DOM node, this scenario is a bit whacky.</p>
<p>Finally, you can&#8217;t add a text node, to {document}&#8230; if you wanted to, you could add it to say&#8230; document.getElementsByTagName(&#8217;body&#8217;)[0]</p>
<p>E.g.</p>
<p>document.getElementsByTagName(&#8217;body&#8217;)[0].appendChild(document.createTextNode(&#8217;Huh?&#8217;));</p>
<p>Now, that all said, the following code, as you mentioned, still doesn&#8217;t work. <img src='http://erik.eae.net/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>var f = document.getElementsByTagName(&#8217;body&#8217;)[0].appendChild;<br />
alert(f); //Native Function&#8230;<br />
alert(f.arity); //1 (only 1 argument expected)&#8230;<br />
f.call( document.createTextNode(&#8217;Huh?&#8217;) );</p>
<p>Cheers,<br />
Steve</p>
]]></content:encoded>
	</item>
</channel>
</rss>
