Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

jquery cancel ajax request on click

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()
 
PREVIOUS NEXT
Tagged: #jquery #cancel #ajax #request #click
ADD COMMENT
Topic
Name
9+6 =