PDA

View Full Version : Flash Detection Query



Mousekiller49
Mar 5th, 2007, 03:07 PM
hey guys, was just wondering if anyone could help me spot the error of my ways, i am probably missing something really obvious but cannot get the below to work at all, its supposed to detect if flash is installed and if not render an image instead... any suggestions

<script language="Javascript" type="text/javascript">

if (navigator.plugins["Shockwave Flash"])
{
document.write
("
<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
WIDTH="800" HEIGHT="160" id="header" ALIGN="center">
<PARAM NAME=movie VALUE="header.swf">
<PARAM NAME=quality VALUE=high>
<PARAM NAME=bgcolor VALUE=#5D5F29>
<EMBED src="header.swf" quality=high bgcolor=#5D5F29
WIDTH="800" HEIGHT="160" NAME="header" ALIGN="center"
TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">
</EMBED> </OBJECT>
")
}
else
{
document.write
("
<img src='headermainimage.png' alt='main header image'
width='800' height='160' \/>
")
}
</script>