Hey, I am trying to get a sound to play when the user moves the mouse over on of my links. I don't know javascript, I just copied this code from a book, so it's probably something simple. Here is my code:

<script language="JavaScript" type="text/javascript">
      function playSound()
      {
      src="misc020.wav";
      }
</script>

<A HREF="http://www.newhorizondesigns.org" onMouseOver="playSound()">Home</A></td>

the java script doesnt work ... can v include some other class or script to run music in web page or ... some other thing to do ??????

That's weird looking script. I can't see any way that it could work - in that context; 'src' wont relate to anything useful.

This page has some example code (lots of examples); it won't work for me; but I'm not on a computer with many media plugins:

http://www.phon.ucl.ac.uk/home/mark/audio/play.htm

Hope that helps some...

thanks I used #4 on that list, and it works, check it out, the links on the left side of the page are where it is designed to play: http://www.newhorizondesigns.org

This article has been dead for over six months. Start a new discussion instead.