如何(通过使用javascript)仅在文件上传完成后才执行函数?我的意思是 'uploading2' 仅在 '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();
}