title: javascript audio onload
body: <p>I made a javascript audio test. All the function works in Opera FF and Chrome, except audio.oncanplaythrough, and audio.onended (this 2function dont work on Chrome).</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;body&gt;
  
  &lt;script&gt;
  var audio = new Audio("http://www.w3schools.com/html5/song.ogg");
  
  audio.oncanplaythrough = function(){
  audio.play();
  }
  
  audio.onended = function(){
  alert('ended');
  }
  
  &lt;/script&gt;
  &lt;a href="#" onclick="audio.play();"&gt;start&lt;/a&gt;&lt;br/&gt;
  &lt;a href="#" onclick="audio.pause();"&gt;pause&lt;/a&gt;&lt;br/&gt;
  &lt;a href="#" onclick="audio.volume=prompt('from 0 to 1',0.7)"&gt;volume&lt;/a&gt;&lt;br/&gt;
  &lt;a href="#" onclick="audio.currentTime = 3;"&gt;jump&lt;/a&gt;&lt;br/&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>