<code>
function
getSize(){
size = 0;
imgURL = form1.file.value;
imgURLsplice = imgURL.split("\").pop();
imgURLsplicelocal =
"../assets/img/"
+ imgURLsplice;
img =
new
Image();
img.src = imgURLsplicelocal;
pic.src = imgURLsplicelocal;
if
(size <= 0){
size = img.
fileSize
/ 1024;
}
alert(
"图片大小为:"
+ size +
"KB"
);
}</code>