一个JS方法里两个提交的问题?
function verify(){
document.addUpload.action= "/hollycrm/attach/attachAdd.do ";
document.addUpload.enctype= "multipart/form-data ";
document.addUpload.method= "post "
document.addUpload.submit();
//问题所在处 ------
alert( "上传完毕! ");
location.href= "/BudgetUploadBO.do?cmd=fromExcel ";
}
问题:在问题所在处的上下是两个方法,我需要就是等上面那个执行完毕下面这个才执行..请问达人,大人们.这个该怎么办.困扰一天了.
------解决方案--------------------不要试图在一个页面中解决,应该先提交,再在attachAdd.do对应的action中加入
out.print( "
<html> <body> <script>
alert( "上传完毕! ");
location.href= "/BudgetUploadBO.do?cmd=fromExcel ";
</script> </body> </html>
");