Detects if user has Flash

Started by nithyasubramanian, Jan 04, 2009, 06:51 PM

Previous topic - Next topic

nithyasubramanian

Description : This code will detect is the user has the flash plug in. And then redirect to a page with flash or one without.

<HTML>
<HEAD>
<TITLE>www.PrebenMusic.com</TITLE>
<META name="GENERATOR" content="PrebenMusic scripts">
</HEAD>
<BODY BGCOLOR=#000000 Text=FFFFFF LINK=FFFFFF>
<SCRIPT LANGUAGE="JavaScript">
<!--
var useFlash = navigator.mimeTypes &&
navigator.mimeTypes["application/x-shockwave-flash"] &&
navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin;
//-->
</SCRIPT>
<SCRIPT LANGUAGE="VBScript">
<!--
On Error Resume Next
useFlash = Not IsNull(CreateObject("ShockwaveFlash.ShockwaveFlash"))
-->
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript">
<!--
If ( useFlash ) {
window.location = "pagewithflash.htm";
} Else {
window.location = "otherpage.htm";
}
//-->
</SCRIPT>
</BODY>
</HTML>

Thanks and Regards
- Nithya Subramanian
Kenvivo Communications
http://nithya-subramanian.blogspot.com/

nandagopal




Its not working ,could you help me

I guess there is bug in the code