如何停止进程进入for循环以使用jquery-confirm确认消息

时间:2019-03-14 10:59:25

标签: javascript ajax jquery-confirm

有人可以帮助我实现这一目标吗? 我想在jquery中调用异步函数,并想停止一个过程,直到按我执行的顺序完成请求为止。使用jquery + ajax + python

$("upload_input").change( function(){
   var opration = chcekFileonServer(filedata) // should complete first
   uploadFileonServer(filedata,opration) // should complete second after finish first
   print filename return by server // lastly 
}

chcekFileonServer(filedata){
 //use ajax call 
 if file exist
    print confirm message to overwrite or copy //how to stop process here until I am not getting yes or no response from a user.
    return file_name // return filename and userresponse(overwrite or copy)
}

uploadFileonServer(filedata){
  //use ajax call 
  upload file to the server using ajax
  return file_name 
}

0 个答案:

没有答案