通过它我们可以查看到图片的大小
————————————
代码
------------
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 7.0">
<TITLE></TITLE>
</HEAD>
<SCRIPT LANGUAGE=javascript>
<!--
function changephoto()
{
document.all.img1.src=document.all.file1.value;
}
function show ()
{
if (document.all.file1.value=="")
alert ("还没有选择图片");
else
alert ("选择的图片大小:" + document.all.img1.fileSize +"/n宽度:" + document.all.img1.width + "/n高度:" + document.all.img1.height);
}
//-->
</SCRIPT>
<BODY>
<FORM action="" method=POST id=form1 name=form1>
<P><INPUT id=file1 type=file name=file1 οnchange="changephoto()"></P>
</FORM>
<a href="Javascript:show()">test</a>
<br>
<img Id="img1" src="10_r2_c1.jpg" >
</BODY>
</HTML>
————————————
代码
------------
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 7.0">
<TITLE></TITLE>
</HEAD>
<SCRIPT LANGUAGE=javascript>
<!--
function changephoto()
{
document.all.img1.src=document.all.file1.value;
}
function show ()
{
if (document.all.file1.value=="")
alert ("还没有选择图片");
else
alert ("选择的图片大小:" + document.all.img1.fileSize +"/n宽度:" + document.all.img1.width + "/n高度:" + document.all.img1.height);
}
//-->
</SCRIPT>
<BODY>
<FORM action="" method=POST id=form1 name=form1>
<P><INPUT id=file1 type=file name=file1 οnchange="changephoto()"></P>
</FORM>
<a href="Javascript:show()">test</a>
<br>
<img Id="img1" src="10_r2_c1.jpg" >
</BODY>
</HTML>