Answers for "jquery form ajax complete"

1

jquery ajax form submission

$(function() {
  $('form.my_form').submit(function(event) {
    event.preventDefault(); // Prevent the form from submitting via the browser
    var form = $(this);
    $.ajax({
      type: form.attr('method'),
      url: form.attr('action'),
      data: form.serialize()
    }).done(function(data) {
      // Optionally alert the user of success here...
    }).fail(function(data) {
      // Optionally alert the user of an error here...
    });
  });
});
Posted by: Guest on December-22-2020
2

all ajaxcomplete event

//when document load and complete all ajax response this event will fire only one time
$(document).ajaxStop(function(){
  alert("All AJAX requests completed");
});
Posted by: Guest on May-04-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language