Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

whats wrong with this code?

Status
Not open for further replies.

stevelitt99

Programmer
Aug 3, 2000
3
US
this is javascript code used to put up a flash movie if the user has flash, or put up an animated gif if they don't. everything looks right. what's wrong with it?<br><br>(this is in the &lt;head&gt;)<br><br>&lt;script&gt;<br>(navigator.plugins && navigator.plugins[&quot;Shockwave Flash&quot;])<br>¦¦ navigator.plugins[&quot;Shockwave Flash 4.0&quot;])<br>&nbsp;&nbsp;&nbsp;{swok = 1;}<br>else<br>&nbsp;&nbsp;&nbsp;{swok = 0;}<br>&lt;/script&gt;<br><br>the body script says basically to put up the flash movie if swok == 1 or put up the gif if swok == 0, but the problem lies in the header. it for some reason plays the gif everytime, leading me to believe it does not understand the code searching for the flash plugin.<br>-Or, if you have better code for this situation that would certainly help.<br><br>
 

Where is the if and the function?

And you are missing a parenthesis. Either add a parenthesis before ((navigator.plugins && ... or delete the parenthesis before the || nav...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top