Answers for "ajax finally"

1

finally in ajax call

$.ajax({
        type: "GET",
        dataType: dataType,
        contentType: contentType,
        async: TRUE,
        url: $('html form:nth-child(1)').attr('action') + "?" $('html form:nth-child(1)').serialize(),
        success: function(data) {
            console.log("FUNFOU!");
        },
        error: function(data) {
            console.log("NÃO FUNFOU!");
        },
        complete: function(data) {
            console.log("SEMPRE FUNFA!"); 
            //A function to be called when the request finishes 
            // (after success and error callbacks are executed). 
        }
    });
Posted by: Guest on January-15-2021
-1

jquery ajax on fail

fail: function(xhr, textStatus, errorThrown){
	alert('request failed');
}
Posted by: Guest on October-05-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language