title: Jquery refresh image after source change
body: <p>I have a JavaScript function where I play a sound file (using phonegap). It normally works fine but I want to change the <code>img src</code> to a loading icon while the file is being downloaded. However, the src is changed
  after the file is played.</p>
  
  <p>I tried to add <code>+new Date().getTime()</code> to the end of src, but it didn't help. Any idea out there?</p>
  
  <pre><code>function playSound(){
  
  
  var img = $(this).prev();
  
  img.attr("src", "css/images/ajax-loader.gif?"+new Date().getTime());
  
  
  var url = "http://some.com/fanky.mp3";   
  mediaTTS = new Media(url, onSuccessTTS(url), onErrorTTS);
  mediaTTS.play();
  
  }
  </code></pre>