I have a function that is called by a dropdown change. It is possible that the function is running and the user changes the dropdown.
If that happens I want the function that is running to stop.
Ex.
$('.txtCategory').change(function(){
ajaxPost('para', 'meters').stop(); //doesn't work
$('#Submit').attr('data-check', 'on');
$('#Submit').val('Stop Checking');
});
Is this possible?
Thanks in advance!
Greets,
Guido
This isn’t possible for a simple reason : your script execution happens on only one thread, only one function can run at a time.
Any callback responding to a local event or to a query won’t be called until the current function has finished execution.