Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: flash detection javascript not working


Message #1 by Jonathan McNeil <juronimo@y...> on Thu, 30 Aug 2001 22:11:49 -0700 (PDT)
I have this javascript code that is supposed to detect
if a browser has the flash plugin installed. If it is
not installed, the javascript is supposed to redirect
the user to a non-flash site. It doesn't work in IE
and it instead attempts to download the flash plugin.
If you chose no then it still redirects to the flash
site. What is wrong with my code?

Thanks
Jonathan

function detectIT()
{
	if ((navigator.appName == "Microsoft Internet
Explorer" &&
		navigator.appVersion.indexOf("Mac") == -1 && 
		navigator.appVersion.indexOf("3.1") == -1) ||
		(navigator.plugins && navigator.plugins["Shockwave
Flash"]) ||
		navigator.plugins["Shockwave Flash 2.0"] || 
		(navigator.mimeTypes &&
navigator.mimeTypes["application/x-shockwave-flash"]))
	{
			document.frmDetect.flash.value = 1;
	}
	else 
	{
	    document.frmDetect.flash.value = 0;
	}
	document.frmDetect.submit();
}

  Return to Index