Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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()
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #kill #ajax #request
ADD COMMENT
Topic
Name
7+1 =