I have a function which calls to the backend to retrieve information and then displays it. My problem is if the user goes back and forth over many cells, it seems to not catch up in time and display everything the user went over instead of what the current cell is, like its lagging bad displaying multiple elements instead of the intended one. Is there a way to make sure that it only happens to the current cell instead of it lagging bad and catching up?
$('body').on('mouseenter', '.cell', function (e) {
var cellNumber = $(this).attr("cellNumber");
// load the data via ajax
$.get('/Main/Sub', { cellNumber: cellNumber },
function(responseText){
// code
}).on('mouseout', function(){
$(this).remove();
});
});