Why ajax is sending multiple POSTs?

Why ajax is sending multiple POSTs?

Hi

In the video.. why ajax sends multiple POSTs? sometimes, 2, 3, 4 or 5 times..

https://www.jassimrahma.net/temp/2017-07-05_0325.swf

I have nothing in my PHP does that..

Here is the code:

  1. $("#frmContact").on("submit", function (event) {
  2.     event.preventDefault();

  3.     var formData = new FormData();

  4.     formData.append("savanna_account", Savanna.savanna_account);
  5.     formData.append("customer", customer_id);

  6.     if (e.component.option("tag"))
  7.     {
  8.         formData.append("contact_id", contact_id);
  9.     }

  10.     formData.append("category", "cat");
  11.     formData.append("details", "details");
  12.     formData.append("user_id", Savanna.user_id);

  13.     $.ajax({
  14.         type: "POST",
  15.         url: 'https://www.mydomain.com/save_new_contact.php',
  16.         async: true,
  17.         data: formData,
  18.         processData: false,
  19.         contentType: false,
  20.         beforeSend: function () {
  21.             // disable button            
  22.         },
  23.         success: function (data) {
  24.               // close window
  25.         },
  26.         error: function (xhr, status, error) {
  27.             alert('Failed to save contact!<br>Please check your connection.');
  28.         }
  29.     });
  30. });

Thanks,