¡@

Home 

2014/10/16 ¤W¤È 12:02:05

jquery Programming Glossary: audioelement.setattribute

Sound notifications in Opera

http://stackoverflow.com/questions/17791602/sound-notifications-in-opera

now this function to generate the sound function notificationSound var audioElement document.createElement 'audio' audioElement.setAttribute 'src' http document.domain files notification2.mp3 audioElement.setAttribute 'type' 'audio mpeg' audioElement.setAttribute.. document.createElement 'audio' audioElement.setAttribute 'src' http document.domain files notification2.mp3 audioElement.setAttribute 'type' 'audio mpeg' audioElement.setAttribute 'autoplay' 'autoplay' audioElement.load audioElement.addEventListener load.. 'src' http document.domain files notification2.mp3 audioElement.setAttribute 'type' 'audio mpeg' audioElement.setAttribute 'autoplay' 'autoplay' audioElement.load audioElement.addEventListener load function audioElement.play true In order to add..

Play an audio file using jQuery when a button is clicked

http://stackoverflow.com/questions/8489710/play-an-audio-file-using-jquery-when-a-button-is-clicked

And you must put this script to body script document .ready function var audioElement document.createElement 'audio' audioElement.setAttribute 'src' 'audio.mp3' audioElement.setAttribute 'autoplay' 'autoplay' audioElement.load .get audioElement.addEventListener load.. document .ready function var audioElement document.createElement 'audio' audioElement.setAttribute 'src' 'audio.mp3' audioElement.setAttribute 'autoplay' 'autoplay' audioElement.load .get audioElement.addEventListener load function audioElement.play true '.play'..