<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: DOM removal and events</title>
	<atom:link href="http://www.nicollet.net/2010/01/dom-removal-and-events/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.nicollet.net/2010/01/dom-removal-and-events/</link>
	<description>Everyone Loves Me</description>
	<lastBuildDate>Sat, 11 Feb 2012 20:32:15 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
	<item>
		<title>By: That DOM removal thing, again at Nicollet.Net</title>
		<link>http://www.nicollet.net/2010/01/dom-removal-and-events/comment-page-1/#comment-17857</link>
		<dc:creator>That DOM removal thing, again at Nicollet.Net</dc:creator>
		<pubDate>Fri, 22 Jan 2010 09:12:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.nicollet.net/?p=1248#comment-17857</guid>
		<description>[...] this month, I pondered what looked like a bug in JavaScript/DOM/jQuery: removing an element from the DOM with jQuery (either manually with remove() or by setting the [...]</description>
		<content:encoded><![CDATA[<p>[...] this month, I pondered what looked like a bug in JavaScript/DOM/jQuery: removing an element from the DOM with jQuery (either manually with remove() or by setting the [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Victor Nicollet</title>
		<link>http://www.nicollet.net/2010/01/dom-removal-and-events/comment-page-1/#comment-17079</link>
		<dc:creator>Victor Nicollet</dc:creator>
		<pubDate>Fri, 08 Jan 2010 10:19:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.nicollet.net/?p=1248#comment-17079</guid>
		<description>@Adam and Tom: thank you for your answers. I already know why the element itself sticks around and can be inserted into the DOM again: JS is a garbage-collected language, and the DOM elements stay alive as long as they are referenced. 

What I don&#039;t know is why the click event I registered on the object disappears.</description>
		<content:encoded><![CDATA[<p>@Adam and Tom: thank you for your answers. I already know why the element itself sticks around and can be inserted into the DOM again: JS is a garbage-collected language, and the DOM elements stay alive as long as they are referenced. </p>
<p>What I don&#8217;t know is why the click event I registered on the object disappears.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tom</title>
		<link>http://www.nicollet.net/2010/01/dom-removal-and-events/comment-page-1/#comment-17059</link>
		<dc:creator>Tom</dc:creator>
		<pubDate>Fri, 08 Jan 2010 02:07:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.nicollet.net/?p=1248#comment-17059</guid>
		<description>Emptying the body doesn&#039;t destroy the reference to the element you created. Imagine creating a variable with a string. Would you expect that to suddenly disappear if you emptied the body? In the same way, the element you created a reference for (in this case button), still exists, with or without the page.</description>
		<content:encoded><![CDATA[<p>Emptying the body doesn&#8217;t destroy the reference to the element you created. Imagine creating a variable with a string. Would you expect that to suddenly disappear if you emptied the body? In the same way, the element you created a reference for (in this case button), still exists, with or without the page.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: adam j. sontag</title>
		<link>http://www.nicollet.net/2010/01/dom-removal-and-events/comment-page-1/#comment-17054</link>
		<dc:creator>adam j. sontag</dc:creator>
		<pubDate>Fri, 08 Jan 2010 00:19:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.nicollet.net/?p=1248#comment-17054</guid>
		<description>because removing an element from the dom does NOT destroy it.  it merely removes the element from the dom.  the reference to a button element does not go away just because the body is emptied.  

this is useful for working with elements &quot;off of the dom&quot; which will prevent additional reflows and help with performance, for instance.

var foo = $(&quot;#foo&quot;).remove(), width = foo.width();

foo.children(&quot;div&quot;).addClass(&quot;hello&quot;).css(&quot;with&quot;,width); 

foo.insertBefore(&quot;#bar&quot;);</description>
		<content:encoded><![CDATA[<p>because removing an element from the dom does NOT destroy it.  it merely removes the element from the dom.  the reference to a button element does not go away just because the body is emptied.  </p>
<p>this is useful for working with elements &#8220;off of the dom&#8221; which will prevent additional reflows and help with performance, for instance.</p>
<p>var foo = $(&#8220;#foo&#8221;).remove(), width = foo.width();</p>
<p>foo.children(&#8220;div&#8221;).addClass(&#8220;hello&#8221;).css(&#8220;with&#8221;,width); </p>
<p>foo.insertBefore(&#8220;#bar&#8221;);</p>
]]></content:encoded>
	</item>
</channel>
</rss>

