Answers for "javascript kill ajax request"

0

javascript kill ajax request

//This kill only the request
//If the server handled the request, the .abort() function won't kill it
var xhr = $.ajax({
    type: "POST",
    url: "some.php",
    data: "name=John&location=Boston",
    success: function(msg){
       alert( "Data Saved: " + msg );
    }
});

//kill the request
xhr.abort()
Posted by: Guest on October-15-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language