title: Read local image file to img using HTML5 FileReader
body: <p>I am trying to read local image file to img element. But <code>readAsDataURL()</code> seems to return "undefined". What am I doing wrong?</p>
  
  <pre><code>var input = $('.mapimage_input').get(0);
  console.log(input); // &lt;input type="file" class="mapimage_input" accept="image/jpeg"&gt;
  var file = input.files[0];
  console.log(file); // File {webkitRelativePath: "", lastModifiedDate: Fri Mar 30 2012 12:32:03 GMT+0200, name: "avatar.jpg", type: "image/jpeg", size: 8724…}
  var fr = new FileReader();
  var img = fr.readAsDataURL(file);
  console.log(img); // undefined
  $('.mapimage_layer').attr('src',img);
  </code></pre>