0 Members and 1 Guest are viewing this topic.

AuthorTopic: javascript function play audio files  (Read 1677 times)

Offline aegkaluk

  • Administrator
  • Hero Member
  • *****
  • Posts: 1103
  • Total Like : 0
    • Email
« on: 16, 11, 2011, 14:58:05 »
Code: [Select]
<script language="JavaScript">

function play(file) {
    var embed = document.createElement("embed");
 
    embed.setAttribute('src', file);
    embed.setAttribute('hidden', true);
    embed.setAttribute('autostart', true);
 
    document.body.appendChild(embed);
}

$(document).ready(function() {
   
   
    play("../sounds/ALARM2.WAV");
    alert("Demo");
});   
   


</script>