Unfailing Javascript Image Preview

Posted by Jason on Stack Overflow See other posts from Stack Overflow or by Jason
Published on 2010-04-30T22:30:53Z Indexed on 2010/05/02 17:48 UTC
Read the original article Hit count: 298

I have the following code that presents the user with a preview of the image they're trying to upload and works really well in FF:

var img = document.createElement('img');
img.src = $('#imageUploader').get(0).files[0].getAsDataURL();

The problem is, getAsDataURL() only works in FF. Is there something similar/a workaround for this kind of functionality in Chrome (specifically)?

© Stack Overflow or respective owner

Related posts about google-chrome

Related posts about JavaScript