Last active
August 21, 2022 15:24
-
-
Save tingwei628/4e0ec5a3b6f5bb523f4d3ff034f8135b to your computer and use it in GitHub Desktop.
abort xhr request
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var xhr = new XMLHttpRequest(), | |
method = "your_api_method", | |
url = "you_api"; | |
xhr.open(method, url, true); | |
xhr.send(); | |
setTimeout(() => { | |
xhr.abort(); | |
}, 1000) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment