Created
July 23, 2012 17:14
-
-
Save divinity76/3164792 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function beep() | |
{ | |
var audoElement=document.createElement("audio"); | |
document.body.appendChild(audoElement); | |
audoElement.addEventListener('canplaythrough',function(e){e.target.play();}); | |
audoElement.addEventListener('ended',function(e){e.target.parentNode.removeChild(e.target);}); | |
audoElement.src="http://www.soundjay.com/button/beep-7.mp3"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Warning: even recent versions of Firefox (firefox 18/14.02.2013) can't play ".mp3" files -.-, get a .ogg-file instead!