title: Rails image preview across all browsers
body: <p>Is it possible to preview image (on upload) before saving across all the browsers.
  I have implemented this way for Firefox:</p>
  
  <pre><code>document.getElementById("preview-photo").src = what.files[0].getAsDataURL();
  </code></pre>
  
  <p>this works fine, and, for IE</p>
  
  <pre><code>document.getElementById("preview-photo").src = what.value;
  </code></pre>
  
  <p>this docent work and same case with other browsers like Chrome and Safari.
  Currently I can see preview only in Firefox, other browsers not showing preview.</p>
  
  <p>Please, advise me how to work on this.</p>
  
  <p>Thanks</p>