XMLHttpRequestEventTarget.onabort
XMLHttpRequestEventTarget.onabort
は、 XMLHttpRequest.abort()
関数が呼ばれたときなどの XMLHttpRequest
トランザクションが中止されたときに呼び出される関数です。
構文
XMLHttpRequest.onabort = callback;
値
callback
は、トランザクションが中止されたときに実行される関数です。
例
var xmlhttp = new XMLHttpRequest(),
method = 'GET',
url = 'https://developer.mozilla.org/';
xmlhttp.open(method, url, true);
xmlhttp.onabort = function () {
console.log('** The request was aborted');
};
xmlhttp.send();
//..
xmlhttp.abort(); // This will invoke our onabort handler above
仕様
仕様 | ステータス | 備考 |
---|---|---|
XMLHttpRequest | 現行の標準 | WHATWG living standard |
ブラウザーの互換性
BCD tables only load in the browser