Use success () o complete () en la llamada AJAX

Quiero entender la llamada AJAX a continuación, en términos de lacomplete() método;

Cuando reemplacecomplete() consuccess(), Me sale un vacíoresponseText Al igual que con el AJAXerror() método.

Por otro lado, cuando salgo de lacomplete() Método allí como es, todo funciona como se espera.

Es esosuccess() devuelve antes decomplete()?

$("#formnaw").submit(function() {
  var fnc = invoerFnc.attr("value");
  var vnaam = invoerVnaam.attr("value");
  var anaam = invoerAnaam.attr("value");
  var str1 = invoerStr1.attr("value");
  var nr1 = invoerNr1.attr("value");
  var pc1 = invoerPc1.attr("value");
  var pl1 = invoerPl1.attr("value");
  var tel1 = invoerTel1.attr("value");
  var mob1 = invoerMob1.attr("value");
  var em1 = invoerEm1.attr("value");
  var goknop = $("#formnaw > .instelling_go");
  //we deactiveren de submit knop tijdens het verzenden 
  goknop.attr({
    disabled: true
  });
  goknop.blur();
  //stuur de post variabelen naar livetabs.php
  $.ajax({
    type: "POST",
    url: "registraties/instellingenact.php",
    data: "actie=wijzignaw&vnaam=" + vnaam + "&anaam=" + anaam + "&functie=" + fnc + "&straat=" + str1 + "&nr=" + nr1 + "&postcode=" + pc1 + "&plaats=" + pl1 + "&tel=" + tel1 + "&mob=" + mob1 + "&email=" + em1,
    timeout: 5000,
    success: function(data, textStatus) {
        alert('bij success');
        //doe iets
      } //EINDE success
      ,
    error: function(XMLHttpRequest, textStatus, errorThrown) {
        if (textStatus == 'timeout') {
          //doe iets
        } else if (textStatus == 'error') {
          //doe iets
        }
        //her-activeer de zend knop
        goknop.attr({
          disabled: false
        });
      } //EINDE error
      ,
    complete: function(data) {
        updatelijst.append(data.responseText + "<br>");
        if (data.responseText.indexOf("Fout") != -1) {
          $('#formnaw').find('td.foutnr1').prepend(data.responseText);
        } else {
          updatelijst.animate({
            opacity: 'show'
          }, 1000, function() {});
        }
        //her-activeer de zend knop
        goknop.attr({
          disabled: false
        });
      } //EINDE complete
  }); //EINDE ajax
  //we stoppen het standaard gedrag van een submit, zodat de pagina niet wordt vernieuwd.
  return false;
});

Respuestas a la pregunta(3)

Su respuesta a la pregunta