[removed] Detect form submission completion

2019-02-26 00:01发布

I have a form in an iframe and submit it. How can I tell when the submission completes? I'm using jQuery to submit the form but don't think there's a callback:

$("#myForm").submit(); // how to attach event to submission complete?

2条回答
走好不送
2楼-- · 2019-02-26 00:22

If you submit a form, it goes to the next page, so there's nothing else that executes on that page.

查看更多
混吃等死
3楼-- · 2019-02-26 00:38

Submission of the form will redirect you to the next page.

But you can always try the ajax function

http://api.jquery.com/jQuery.ajax/

Adding callback is as easy as

 $.ajax({
   url: "page.php",
   success: function() {
      doWhateverYouWant();
   }
 });
查看更多
登录 后发表回答