Why does my onclick“” not work?

Michael

New Member
Here is the link to the page I am working on for reference, but you don't have to look at it.http://speechsci.com/evals/ppvt/Lugubrious/Actual/Training/Training_Pages.html Disclaimer: Don't worry about my code being "standards compliant"Basically, the page I am making is supposed to play a short audio clip upon loading using the \[code\]<object data="http://stackoverflow.com/questions/15727446/someAudio.wav">\[/code\] tag. I then use Javascript and setTimeout() to play a couple of other audio files after a few seconds of delay. The setTimeout does this by using innerHTML and rewriting the correct div section with with a new object, where the object is just another audio. For example:\[code\]<script type="text/javascript">setTimeout("update_audio()", 2500);function update_audio(){ document.getElementById('slide_audio').innerHTML="<object classid='clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95' height='0' width='0'><param name='FileName' value='http://stackoverflow.com/Audio_general/good.wav'><param name='autoplay' value='http://stackoverflow.com/questions/15727446/true'><object type='audio/mpeg' height='0' width='0' data='http://stackoverflow.com/Audio_general/good.wav'><param name='controller' value='http://stackoverflow.com/questions/15727446/true'><param name='autoplay' value='http://stackoverflow.com/questions/15727446/false'></object></object>";}</script>\[/code\]I have the image linked to a map so that it is divided up into the 4 sections. When I click on a section, it will call a function that will perform logic based on my selection and then should play 1 of 2 other audio files. Section of map code here:\[code\]<map id="testing_image" name="pictureMap"> <area id="image1" shape="rect" coords="0, 0, 449, 331" onclick="evaluate_status(1);" onmouseover="this.style.cursor='pointer'" alt="FB"></map>\[/code\]My problem is, the \[code\]onclick="evaluate_status()"\[/code\] parts of the map will only work before I update the innerHTML. Meaning, if I can click on a section before 2.5 seconds (the first innerHTML update) it will play the correct audio. However, after it updates the div section using innerHTML, none of the onclicks of my map will work. I am confused as to why this is since only a small section is being changed.Can anyone help me figure out why the onclicks don't work and how I can fix it? I am still pretty new to web design and really need the assistance. Thanks!
 
Back
Top