<?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>Tech Mug &#187; animation</title>
	<atom:link href="http://www.techmug.com/tag/animation/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.techmug.com</link>
	<description></description>
	<lastBuildDate>Tue, 31 Jan 2012 12:15:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Detect Javascript and Flash Enabled</title>
		<link>http://www.techmug.com/detect-javascript-and-flash-enabled/</link>
		<comments>http://www.techmug.com/detect-javascript-and-flash-enabled/#comments</comments>
		<pubDate>Wed, 06 Jan 2010 18:56:07 +0000</pubDate>
		<dc:creator>Fraz Ahmed</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[animation]]></category>
		<category><![CDATA[Detect Javascript]]></category>
		<category><![CDATA[Flash Enabled]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[swf]]></category>
		<category><![CDATA[tactic]]></category>

		<guid isPermaLink="false">http://www.techmug.com/?p=73</guid>
		<description><![CDATA[Javascript and Flash are super tools to enhance the usability of your website. You put a lot of efforts to create beautiful form validation and an attractive flash animation. But all the efforts are ruined when the visitor of your website has disabled Javascript or does not have flash plugin installed. Here I&#8217;ll provide you [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Javascript and Flash</strong> are super tools to enhance the usability of your website. You put a lot of efforts to create beautiful form validation and an <strong>attractive flash animation</strong>. But all the efforts are ruined when the visitor of your website has disabled Javascript or does not have flash plugin installed. Here I&#8217;ll provide you a little solution to escape from this problem.</p>
<p><span id="more-73"></span></p>
<h2>First Tactic &#8211; Detect Javascript Enabled</h2>
<p>Our first step is to detect whether visitor has Javascript enabled or not. If Javascript is not enable, we will redirect user to an error/instruction page <em>(I create a seperate page where I give instructions to visitor that how to enable Javascript in his/her browser)</em>.</p>
<p>Put below code just after the <em>&lt;head&gt;</em> tag in your web page:</p>
<pre class="brush: php; title: ; notranslate">
&lt;noscript&gt;
&lt;meta http-equiv=&quot;refresh&quot; content=&quot;0;URL=error-javascript.php&quot; /&gt;
&lt;/noscript&gt;
</pre>
<p>Above code is executed if Javascript is disabled and redirect user to <em>error-javascript.php</em>. We are using <em>&lt;meta&gt;</em> tag for redirection. If Javascript is not disabled, above code will not be executed.</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-7217075623453662";
google_ad_slot = "2820701010";
google_ad_width = 336;
google_ad_height = 280;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<center><font-size="9px">Advertisement</font></center></p>
<h2><strong>Second Tactic- Detect Flash Plugin Installed</strong></h2>
<p>There is a<strong> Javascript solution to detect Flash Plugin</strong> Installed and replace Flash animation with your custom message. In order to accomplish the said task you need to place below Javascript instead of your normal embedded code:</p>
<pre class="brush: jscript; title: ; notranslate">
&lt;script type=&quot;text/javascript&quot;&gt;
&lt;!--
var MM_contentVersion = 9;
var plugin = (navigator.mimeTypes &amp;&amp; navigator.mimeTypes[&quot;application/x-shockwave-flash&quot;]) ? navigator.mimeTypes[&quot;application/x-shockwave-flash&quot;].enabledPlugin : 0;
if ( plugin ) {
		var words = navigator.plugins[&quot;Shockwave Flash&quot;].description.split(&quot; &quot;);
	    for (var i = 0; i &lt; words.length; ++i)
	    {
		if (isNaN(parseInt(words[i])))
		continue;
		var MM_PluginVersion = words[i];
	    }
	var MM_FlashCanPlay = MM_PluginVersion &gt;= MM_contentVersion;
}
else if (navigator.userAgent &amp;&amp; navigator.userAgent.indexOf(&quot;MSIE&quot;)&gt;=0
   &amp;&amp; (navigator.appVersion.indexOf(&quot;Win&quot;) != -1)) {
	document.write('&lt;SCR' + 'IPT LANGUAGE=VBScript\&gt; \n'); //FS hide this from IE4.5 Mac by splitting the tag
	document.write('on error resume next \n');
	document.write('MM_FlashCanPlay = ( IsObject(CreateObject(&quot;ShockwaveFlash.ShockwaveFlash.&quot; &amp; MM_contentVersion)))\n');
	document.write('&lt;/SCR' + 'IPT\&gt; \n');
}
if ( MM_FlashCanPlay ) {
	document.write('&lt;object classid=&quot;clsid:d27cdb6e-ae6d-11cf-96b8-444553540000&quot; codebase=&quot;http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0&quot; width=&quot;160&quot; height=&quot;120&quot;&gt;');
    document.write('&lt;param name=&quot;movie&quot; value=&quot;animation.swf&quot;&gt;');
    document.write ('&lt;param name=&quot;quality&quot; value=&quot;high&quot;&gt;');
	document.write ('&lt;param name=&quot;wmode&quot; value=&quot;transparent&quot;&gt;');
    document.write('&lt;embed src=&quot;animation.swf&quot; width=&quot;160&quot; height=&quot;120&quot; quality=&quot;high&quot; pluginspage=&quot;http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash&quot; type=&quot;application/x-shockwave-flash&quot; wmode=&quot;transparent&quot;&gt;&lt;/embed&gt;&lt;/object&gt;');
} else{
	document.write('&lt;a href=&quot;./&quot;&gt;&lt;img src=&quot;replaced-image.png&quot; alt=&quot;Flash Plugin not Installed&quot; border=&quot;0&quot;&gt;&lt;/a&gt;');

}
//--&gt;

&lt;/script&gt;
</pre>
<p>Above code detect for Version 9 or greater version of flash plugin. If flash plugin is detected it displays flash animation <em>(animation.swf)</em> else it displays an image <em>(replaced-image.png)</em> instead of flash animation. In the place of image you can write more text and instructions. Everything is upto on you.</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-7217075623453662";
google_ad_slot = "4831550702";
google_ad_width = 300;
google_ad_height = 250;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<center><font-size="9px">Advertisement</font></center></p>
<p>Don&#8217;t forget to share the post on your favorite website. It may also help someone somewhere.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.techmug.com/detect-javascript-and-flash-enabled/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
	</channel>
</rss>

