<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>djsipe.com &#187; ie</title>
	<atom:link href="http://blog.djsipe.com/tag/ie/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.djsipe.com</link>
	<description>Web Development</description>
	<lastBuildDate>Sat, 31 Dec 2011 16:25:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Click to Activate and Use This Control</title>
		<link>http://blog.djsipe.com/2008/01/20/click-to-activate-and-use-this-control/</link>
		<comments>http://blog.djsipe.com/2008/01/20/click-to-activate-and-use-this-control/#comments</comments>
		<pubDate>Mon, 21 Jan 2008 01:33:00 +0000</pubDate>
		<dc:creator>DJ</dc:creator>
				<category><![CDATA[Front End]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[ie]]></category>

		<guid isPermaLink="false">http://www.djsipe.com/2008/01/20/click-to-activate-and-use-this-control/</guid>
		<description><![CDATA[Ever get that annoying &#8220;Click to activate and use this control&#8221; message in IE when you embed a Flash movie? I did and couldn&#8217;t find a solution that worked as well as I&#8217;d like. A quick browse of my Google results brought be here, but the solution there was kinda sloppy in my opinion. But [...]]]></description>
			<content:encoded><![CDATA[<p>Ever get that annoying &#8220;Click to activate and use this control&#8221; message in IE when you embed a Flash movie?  I did and couldn&#8217;t find a solution that worked as well as I&#8217;d like.  A quick browse of my Google results brought be <a href="http://www.mix-fx.com/flash-prompt.htm" target="_blank">here</a>, but the solution there was kinda sloppy in my opinion.  But with a few tweaks, I got things working&#8230;and with the added street cred&#8217; of not introducing a single global variable.</p>
<p>Here&#8217;s the code:</p>
<pre class="js-codeface">
(function()
{
    var clear = function(a)
    {
        for(var i=0; i &lt; a.length; i++)
        {
            a[i].outerHTML=a[i].outerHTML;
        }
    };

    clear(document.getElementsByTagName("object"));
    clear(document.getElementsByTagName("embed"));
})();</pre>
<p>The original code I found only applied the fix to <code>object</code> tags.  But since use of the <code>object</code> tag is becoming deprecated, we also need to touch the <code>embed</code> tags as well.  The code above does both and is wrapped in an anonymous function to keep all is private bits private.</p>
<p>Finally, since this is an IE-only fix, we should make use of IE&#8217;s <a href="http://www.quirksmode.org/css/condcom.html" target="_blank">conditional comments</a> so other browsers don&#8217;t have to be bothered by the script.  Assuming we placed (a <a href="http://javascript.crockford.com/jsmin.html" target="_blank">minified</a> version of) the code into a file named <code>controlFix.js</code>, we then add the following code at the end of the source code:</p>
<pre class="html-codeface">&lt;!--[if IE]&gt;
&lt;script type="text/javascript" src="controlFix.js"&gt;&lt;/script&gt;
&lt;![endif]--&gt;</pre>
<p>If you&#8217;d like to use this on your site, you can download the minified JavaScript <a href="https://djsipe.code.s3.amazonaws.com/controlFix.zip">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.djsipe.com/2008/01/20/click-to-activate-and-use-this-control/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

