jquery/JavaScript - Delay until upload complete

My jQuery script looks something like (the form is submitting files to upload): $("#addMore").click(function() { $("#progForm").submit(); $("#upTar").css("display","block"); $("#title").val("");$("#obj").val("");$("#theory").val(""); $("#code").val("");$("#output").val("");$("#conc").val(""); }); I want to delay the execution of the code beginning from $("#upTar") until the form submission is completed (that is the files are uploaded and PHP script has responded). **Edit** #upTar is an iframe and the target of the form submission. I want #upTar to be displayed only after its content has been generated from the form action script. Thanks! **Code after solution** $("#addMore").click(function() { $("#progForm").submit(); $('#upTar').load(function() { $("#upTar").css("display","block"); $("#title, #obj, #theory, #code, #output, #conc").val(""); }); });
If that's a real form submit, does the form have a "target" attribute or something, to ensure that the page containing it is not wiped out by the server response? If not, then there's no point doing anything on the page really.

以上就是jquery/JavaScript - Delay until upload complete的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏