title: playing audio in HTML5 after changing source with jQuery
body: <p>The strangest thing: I have a jQuery function that changes the source of an audio player. It works if I insert an "alert()" in between. But otherwise it returns NaN.</p>
  
  <p>jQuery:</p>
  
  <pre><code>$('.playpause').click(function(){
  
    if (playmode==false){
  
      audio = $('#player audio').get(0);
      $(audio).attr('src','newurl.mp3');
      playmode = true;
      /*alert('wait a minute!');*/
      audio.play();
    } 
    else {
    audio.pause();
    playmode = false;}
  })
  </code></pre>
  
  <p>I imagine it has something to do with the browser not having the time to load the data? Any thoughts? Thanks!</p>