troubleshooting Question

onClick not working

Avatar of christamcc
christamccFlag for United States of America asked on
JavaScript
6 Comments1 Solution1452 ViewsLast Modified:
I have this script in my head tag:

<script languange=javascript>
var sMovieName;
function ChangeMovie(NewMovieName){
alert('TheFunctionWasCalled');
sMovieName = NewMovieName;
moviediv.innerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="430" height="287" id="FLVPlayer">
<param name="movie" value="FLVPlayer_Progressive.swf" />
<param name="salign" value="lt" />
<param name="quality" value="high" />
<param name="scale" value="noscale" />
 <param name="FlashVars" value="&MM_ComponentVersion=1&skinName=Clear_Skin_3&streamName=movies/'+sMovieName+'&autoPlay=false&autoRewind=false" />
<embed src="FLVPlayer_Progressive.swf" flashvars="&MM_ComponentVersion=1&skinName=Clear_Skin_3&streamName=movies/'+sMovieName+'&autoPlay=false&autoRewind=false" quality="high" scale="noscale" width="430" height="287" name="FLVPlayer" salign="LT" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />    
</object>';}</script>

This in my body tag:
<a href="#" onClick="ChangeMovie('haley');"><img src="images/thumb_haley.jpg" width="172" height="119" border="0" /></a>

And there is a <div id="moviediv"></div> tag

It's not working - the alert isn't even happening so it seems the function is not being called.

Do you see what's wrong?

thanks!
Christa
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 6 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros