| | |
Trying to get a javascript function to play a sound
Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Feb 2007
Posts: 72
Reputation:
Solved Threads: 0
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:
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
<script language="JavaScript" type="text/javascript"> function playSound() { src="misc020.wav"; } </script> <A HREF="http://www.newhorizondesigns.org" onMouseOver="playSound()">Home</A></td>
My Website <-- check out my site!
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...
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...
Plato forgot the nullahedron..
http://www.javascriptkit.com/script/...oundlink.shtml
don't forget to do a onmouseout=stop or it'll carry on going
don't forget to do a onmouseout=stop or it'll carry on going
•
•
Join Date: Mar 2007
Posts: 3
Reputation:
Solved Threads: 0
I use Sound Manager.
http://www.schillmania.com/projects/soundmanager2/
http://www.schillmania.com/projects/soundmanager2/
•
•
Join Date: Feb 2007
Posts: 72
Reputation:
Solved Threads: 0
•
•
•
•
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...
Last edited by adaykin; Mar 13th, 2007 at 3:23 pm.
My Website <-- check out my site!
![]() |
Similar Threads
- database connection(select ,insert query) within javascript function (JSP)
- How to play sound through stereo speakers (C)
- How to code a program that can play sound (C++)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: Javascript won't work... :(
- Next Thread: Dynamic Iframes
| Thread Tools | Search this Thread |
acid2 ajax ajaxcode ajaxhelp animate array automatically beta box bug calendar cart checkbox class codes column cookies createrange() css cursor date debugger decimal design dom download dropdown editor element enter error events explorer firefox focus form frameworks getselection google gwt html htmlform iframe image() images index internet java javascript jawascriptruntimeerror jquery jsf jsfile jsp listbox maps masterpage math menu microsoft mimic mp4 object onmouseover parent php player post problem programming progressbar prototype rating redirect regex runtime safari scale scriptlets search select session shopping size sql starrating stars text textarea toggle validation variables w3c website window windowofwords windowsxp wysiwyg xml \n






