<?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: IE7 Flash Embed Bug  (Re: The DOM is a Mess)</title>
	<atom:link href="http://polymath.mit.edu/blog/ie7-flash-embed-bug-re-the-dom-is-a-mess/feed/" rel="self" type="application/rss+xml" />
	<link>http://polymath.mit.edu/blog/ie7-flash-embed-bug-re-the-dom-is-a-mess/</link>
	<description>Weblog of a musician, mathematician, web designer, and technologist.</description>
	<lastBuildDate>Tue, 03 Nov 2009 19:59:48 -0500</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Issac Maez</title>
		<link>http://polymath.mit.edu/blog/ie7-flash-embed-bug-re-the-dom-is-a-mess/comment-page-1/#comment-168</link>
		<dc:creator>Issac Maez</dc:creator>
		<pubDate>Tue, 03 Nov 2009 19:59:48 +0000</pubDate>
		<guid isPermaLink="false">http://polymath.mit.edu/blog/?p=203#comment-168</guid>
		<description>Great insight. I agree completely</description>
		<content:encoded><![CDATA[<p>Great insight. I agree completely</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Frank</title>
		<link>http://polymath.mit.edu/blog/ie7-flash-embed-bug-re-the-dom-is-a-mess/comment-page-1/#comment-164</link>
		<dc:creator>Frank</dc:creator>
		<pubDate>Mon, 19 Oct 2009 10:20:06 +0000</pubDate>
		<guid isPermaLink="false">http://polymath.mit.edu/blog/?p=203#comment-164</guid>
		<description>Thanks, that comes in very handy. As I am using mootools for nearly every project, the port is exactly what I need!

keep up the good work!</description>
		<content:encoded><![CDATA[<p>Thanks, that comes in very handy. As I am using mootools for nearly every project, the port is exactly what I need!</p>
<p>keep up the good work!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: adam</title>
		<link>http://polymath.mit.edu/blog/ie7-flash-embed-bug-re-the-dom-is-a-mess/comment-page-1/#comment-142</link>
		<dc:creator>adam</dc:creator>
		<pubDate>Fri, 31 Jul 2009 18:01:42 +0000</pubDate>
		<guid isPermaLink="false">http://polymath.mit.edu/blog/?p=203#comment-142</guid>
		<description>@Willie: Thanks for the mootools port!</description>
		<content:encoded><![CDATA[<p>@Willie: Thanks for the mootools port!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Willie</title>
		<link>http://polymath.mit.edu/blog/ie7-flash-embed-bug-re-the-dom-is-a-mess/comment-page-1/#comment-130</link>
		<dc:creator>Willie</dc:creator>
		<pubDate>Mon, 06 Jul 2009 18:04:45 +0000</pubDate>
		<guid isPermaLink="false">http://polymath.mit.edu/blog/?p=203#comment-130</guid>
		<description>Hi, your solution worked wonderfully!

Let me share with you the &quot;mootools&quot; version. If say all of your problematic DIVs where of class &quot;jw_player&quot;, then the code would be like:

window.addEvent (&#039;beforeunload&#039;, function() {
  $each($$(&#039;jw-player&#039;), function(el) { el.dispose; });
}); 

You can change the class name to whatever you wand and add several $each sentences as classes you have. 

Willie.</description>
		<content:encoded><![CDATA[<p>Hi, your solution worked wonderfully!</p>
<p>Let me share with you the &#8220;mootools&#8221; version. If say all of your problematic DIVs where of class &#8220;jw_player&#8221;, then the code would be like:</p>
<p>window.addEvent (&#8217;beforeunload&#8217;, function() {<br />
  $each($$(&#8217;jw-player&#8217;), function(el) { el.dispose; });<br />
}); </p>
<p>You can change the class name to whatever you wand and add several $each sentences as classes you have. </p>
<p>Willie.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: wk</title>
		<link>http://polymath.mit.edu/blog/ie7-flash-embed-bug-re-the-dom-is-a-mess/comment-page-1/#comment-96</link>
		<dc:creator>wk</dc:creator>
		<pubDate>Mon, 06 Apr 2009 14:46:51 +0000</pubDate>
		<guid isPermaLink="false">http://polymath.mit.edu/blog/?p=203#comment-96</guid>
		<description>Thanks, it worked for me as well, much appreciated.</description>
		<content:encoded><![CDATA[<p>Thanks, it worked for me as well, much appreciated.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: adam</title>
		<link>http://polymath.mit.edu/blog/ie7-flash-embed-bug-re-the-dom-is-a-mess/comment-page-1/#comment-87</link>
		<dc:creator>adam</dc:creator>
		<pubDate>Mon, 23 Mar 2009 21:17:24 +0000</pubDate>
		<guid isPermaLink="false">http://polymath.mit.edu/blog/?p=203#comment-87</guid>
		<description>@Jonathan
No problem. Glad to help.</description>
		<content:encoded><![CDATA[<p>@Jonathan<br />
No problem. Glad to help.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan</title>
		<link>http://polymath.mit.edu/blog/ie7-flash-embed-bug-re-the-dom-is-a-mess/comment-page-1/#comment-86</link>
		<dc:creator>Jonathan</dc:creator>
		<pubDate>Mon, 23 Mar 2009 19:12:50 +0000</pubDate>
		<guid isPermaLink="false">http://polymath.mit.edu/blog/?p=203#comment-86</guid>
		<description>I&#039;ve got Method 2 working!  Thanks!</description>
		<content:encoded><![CDATA[<p>I&#8217;ve got Method 2 working!  Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan</title>
		<link>http://polymath.mit.edu/blog/ie7-flash-embed-bug-re-the-dom-is-a-mess/comment-page-1/#comment-85</link>
		<dc:creator>Jonathan</dc:creator>
		<pubDate>Mon, 23 Mar 2009 03:04:24 +0000</pubDate>
		<guid isPermaLink="false">http://polymath.mit.edu/blog/?p=203#comment-85</guid>
		<description>Seems like Method 2 should be pretty easy for me to do since jQuery is baked in to Drupal and it looks like I can just drop a script.js file into the theme&#039;s folder.

http://drupal.org/node/171213</description>
		<content:encoded><![CDATA[<p>Seems like Method 2 should be pretty easy for me to do since jQuery is baked in to Drupal and it looks like I can just drop a script.js file into the theme&#8217;s folder.</p>
<p><a href="http://drupal.org/node/171213" rel="nofollow">http://drupal.org/node/171213</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan</title>
		<link>http://polymath.mit.edu/blog/ie7-flash-embed-bug-re-the-dom-is-a-mess/comment-page-1/#comment-84</link>
		<dc:creator>Jonathan</dc:creator>
		<pubDate>Mon, 23 Mar 2009 02:30:00 +0000</pubDate>
		<guid isPermaLink="false">http://polymath.mit.edu/blog/?p=203#comment-84</guid>
		<description>Thanks Adam.  I&#039;ll give it a try sometime soon.  I use Drupal, not Wordpress, but presumably Google will be my friend and teach me how to add javascript to my Drupal template, etc.</description>
		<content:encoded><![CDATA[<p>Thanks Adam.  I&#8217;ll give it a try sometime soon.  I use Drupal, not Wordpress, but presumably Google will be my friend and teach me how to add javascript to my Drupal template, etc.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: adam</title>
		<link>http://polymath.mit.edu/blog/ie7-flash-embed-bug-re-the-dom-is-a-mess/comment-page-1/#comment-83</link>
		<dc:creator>adam</dc:creator>
		<pubDate>Mon, 23 Mar 2009 01:56:54 +0000</pubDate>
		<guid isPermaLink="false">http://polymath.mit.edu/blog/?p=203#comment-83</guid>
		<description>@Jonathan
Ahh, I now understand the situation. This can easily be solved in a number of ways. I&#039;ll first tell you the one which will work well with what we already have.

&lt;b&gt;Method 1&lt;/b&gt;

First, check out the &lt;code&gt;addEvent()&lt;/code&gt; function found &lt;a href=&quot;http://www.dustindiaz.com/top-ten-javascript/&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;. Using this function we can get multiple functions to be triggered using the same event. So you&#039;ll want to put this function in a functions.js file on your server and add it to your wordpress template&#039;s &lt;code&gt;&lt;head&gt;&lt;/code&gt;.

Next, to avoid collisions, you&#039;ll want to make sure that the &lt;code&gt;ieFix()&lt;/code&gt; functions are renamed to &lt;code&gt;ieFix_something()&lt;/code&gt; where the &quot;something&quot; is unique from post to post. (Otherwise on the front page we&#039;ll have two javascript functions with the same name.) Other than renaming these functions, the contents can stay the same. (However, again, the &quot;ieFixID1&quot; and similar IDs will also need to be unique throughout the different posts.)

Lastly, instead of writing:

&lt;pre&gt;&lt;code&gt;window.onbeforeunload = ieFix;&lt;/code&gt;&lt;/pre&gt;

you&#039;ll need to write:

&lt;pre&gt;&lt;code&gt;addEvent(ieFix);&lt;/code&gt;&lt;/pre&gt;

The &lt;code&gt;addEvent()&lt;/code&gt; function will take care of the rest.

&lt;b&gt;Method 2&lt;/b&gt;

This method is probably better, but it might be harder for inexperienced javascript developers to follow.

First, download the &lt;a href=&quot;http://jquery.com/&quot; rel=&quot;nofollow&quot;&gt;jQuery&lt;/a&gt; javascript library and add it as a script to your documents &lt;code&gt;&lt;head&gt;&lt;/code&gt;

Next, don&#039;t even bother giving &lt;code&gt;id&lt;/code&gt;&#039;s to all of your embeds. Instead give them all the same &lt;code&gt;class&lt;/code&gt;:

&lt;pre&gt;&lt;code&gt;&lt;embed class=&quot;ieFixMe&quot;&gt;&lt;/embed&gt;&lt;/code&gt;&lt;/pre&gt;

and add this javascript code to your template (not individually to each post).

&lt;pre&gt;&lt;code&gt;window.onbeforeunload = function(){
	$(&quot;.ieFixMe&quot;).remove();
}&lt;/code&gt;&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>@Jonathan<br />
Ahh, I now understand the situation. This can easily be solved in a number of ways. I&#8217;ll first tell you the one which will work well with what we already have.</p>
<p><b>Method 1</b></p>
<p>First, check out the <code>addEvent()</code> function found <a href="http://www.dustindiaz.com/top-ten-javascript/" rel="nofollow">here</a>. Using this function we can get multiple functions to be triggered using the same event. So you&#8217;ll want to put this function in a functions.js file on your server and add it to your wordpress template&#8217;s <code>&lt;head&gt;</code>.</p>
<p>Next, to avoid collisions, you&#8217;ll want to make sure that the <code>ieFix()</code> functions are renamed to <code>ieFix_something()</code> where the &#8220;something&#8221; is unique from post to post. (Otherwise on the front page we&#8217;ll have two javascript functions with the same name.) Other than renaming these functions, the contents can stay the same. (However, again, the &#8220;ieFixID1&#8243; and similar IDs will also need to be unique throughout the different posts.)</p>
<p>Lastly, instead of writing:</p>
<pre><code>window.onbeforeunload = ieFix;</code></pre>
<p>you&#8217;ll need to write:</p>
<pre><code>addEvent(ieFix);</code></pre>
<p>The <code>addEvent()</code> function will take care of the rest.</p>
<p><b>Method 2</b></p>
<p>This method is probably better, but it might be harder for inexperienced javascript developers to follow.</p>
<p>First, download the <a href="http://jquery.com/" rel="nofollow">jQuery</a> javascript library and add it as a script to your documents <code>&lt;head&gt;</code></p>
<p>Next, don&#8217;t even bother giving <code>id</code>&#8217;s to all of your embeds. Instead give them all the same <code>class</code>:</p>
<pre><code>&lt;embed class="ieFixMe"&gt;&lt;/embed&gt;</code></pre>
<p>and add this javascript code to your template (not individually to each post).</p>
<pre><code>window.onbeforeunload = function(){
	$(".ieFixMe").remove();
}</code></pre>
]]></content:encoded>
	</item>
</channel>
</rss>
