The XMLHttpRequest.abort() method aborts the request if it has already been sent.
XMLHttpRequest.abort()
MDN Reference