I want to send post request via ajax, it has to be very fast like under 100 ms. This page also contains other network requests(even image refresh) in setIntervals.
When the below function is called mainRequest()
, I want to stop all other network requests and just send this request. So its fast and high priority request.
function mainRequest()
{
stop(); // something like this that stop all network requests immediately
$.post( "https://example.com", $str ,function(data) {
console.log(data);
})
.fail(function() {
alert( "error" );
});
}
I googled and found about request.abort();
, Is there any alternative that generally aborts all request, including image loads.