Assume we have one button that fires ajax request, ajax call will talk 15 seconds to load the results.
Assume the user clicked on that button first time and waited for 5 seconds, then he/she clicked again. In this case the page will be loaded two times. i.e. first time will be loaded and after finishing the first ajax request, the second one will start!
Is there any way to cancel the second ajax request(both first and second ajax calls come from first button) while having the first one in process?
The problem, if the user clicks more than one time on the same button, then a queue of ajax calls will be executed and the user will wait for long to process all of them. So I need to cancel similar requests that come after first request.
NOTE: I do NOT want to use the Jquery.