开发者

JavaScript: Detect form submission completion

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜