I have the post method as shown below:
$(".buttons").click(function(){
var gettopic=$.post("topic.php", {id: topicId}, function(result){
// codes for handling returned result
});
})
I tried to abort the old post when a new button is clicked: So I tired
$(".buttons").click(function(){
if (gettopic) {
gettopic.abort();
}
var gettopic=$.post("topic.php", {id: topicId}, function(result){
// codes for handling returned result
});
})
However this is not working. So I wondered how this could be fixed?