您的位置:首页 > 其它

FileLoad 直接显示到img标签中 实现预览效果

2010-10-10 21:35 162 查看
<asp:FileUpload ID="FileUp" runat="server" onchange= "document.getElementById('imagePro').setAttribute('src',this.value);"/>
<img id="imagePro" alt="pic" src="images/7ada23552rysffr.gif" style="vertical-align:middle; width: 71px; height: 64px;"/>

貌似document.getElementById( 'imagePro ').src 有时候因为浏览器的原因会不行。

为了兼容各种浏览器。最好写成:
document.getElementById('').setAttribute('src',this.value);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐