仅在文件上载完成后才执行功能。使用Javascript

时间:2013-03-18 09:24:07

标签: javascript

如何(通过使用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();
}

0 个答案:

没有答案
相关问题