javascript - image preview before upload
<p>iam trying to show image preview before upload, for that i am using code given below..</p>

<p>it works with firefox, but, dosent work with IE8</p>

<pre><code>&lt;%= image_tag @image, :id=&gt;"preview-photo" %&gt;
&lt;%= file_field 'image','photo', :onchange =&gt; "preview(this);" %&gt;


function preview(this) {
document.getElementById("preview-photo").src =this.value;
return;
}
</code></pre>

<p>i need help..
Is there any solution to preview the image in IE8 and other browsers?</p>
