如何(通过使用javascript)仅在文件上传完成后才能执行功能?我的意思是'upload2'仅在'submit()'完成后执行。
function uploadimg1() {
document.forms.imgupload.act.value='upload';
document.forms.imgupload.submit();
}
function uploadimg2() {
doc = frames['frm1'].document;
imgs=doc.getElementsByTagName('img').length-1;
img = doc.getElementById(imgs);
opener.document.forms[0].src.value = '<?php echo $IMGURL ?>/'+img.alt;
window.close();
}
function uploadimg() {
uploadimg1();
uploadimg2();
}