JavaScript] 判断file框选择的是否为图片
<FORM name=form action="" method=post encType=multipart/form-data><INPUT onpropertychange=document.all.aaaa.src=this.value type=file name=upload><BR>宽:<INPUT name=W> 高:<INPUT name=H><BR><INPUT type=submit value=提交> <IMG style="POSITION: absolute; TOP: -100000px" onerror='alert("类型错误或者目标不存在");' onload={document.all.W.value=this.width;document.all.H.value=this.height;} name=aaaa> </FORM>