怎样在客户端获取上传图片的长宽?
这样的获取图片将占用一定的空间:
<input id="FileUpload" type="file" size="27" name="FileUpload" onpropertychange="javascript:img2.src=this.value;">
<img id="img2" src="" style="visibility:hidden;"/>
<input type="button" value="获取" onclick="javascript:abc();">
<script language="javascript">
function abc()
{
alert(img2.width);
}
</script>
我想不让图片占有空间,该如何实现?用下面的只能获取一次
function abc()
{
alert(img2.width);
img2.style.display="none";
}
</script>