[英]javascript - image preview before upload
iam trying to show image preview before upload, for that i am using code given below.. 我试图在上传之前显示图像预览,因为我使用下面给出的代码..
it works with firefox, but, dosent work with IE8 它适用于Firefox,但是,它与IE8一起工作
<%= image_tag @image, :id=>"preview-photo" %>
<%= file_field 'image','photo', :onchange => "preview(this);" %>
function preview(this) {
document.getElementById("preview-photo").src =this.value;
return;
}
i need help.. Is there any solution to preview the image in IE8 and other browsers? 我需要帮助..有没有解决方案在IE8和其他浏览器中预览图像?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.