您的位置:首页 > Web前端 > JavaScript

js脚本实现上传图片无刷新预览!

2007-12-04 10:34 736 查看

<html xmlns="http://www.w3.org/1999/xhtml" >


<head runat="server">




<script type="text/javascript">...


function changeimg(imgid,fileid)




...{


document.getElementById(imgid).src=document.getElementById(fileid).value;


}


</script>


<title>无标题页</title>


</head>


<body>


<form id="form1" runat="server">


<img src="" style="width: 117px; height: 63px" id="image1" />


<input id="File2" type="file" runat="server" onchange="changeimg('image1','File2')"/>


</form>


</body>


</html>

效果如图:

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: