开发者

JavaScript: Detect form submission completion

开发者 https://www.devze.com 2023-02-23 14:51 出处:网络
I have a form in an iframe and submit it. How can I tell when 开发者_JAVA百科the submission completes? I\'m using jQuery to submit the form but don\'t think there\'s a callback:

I have a form in an iframe and submit it. How can I tell when 开发者_JAVA百科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?


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();
   }
 });


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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号