blob: d9cea5662ea7bb3f61acd70f5925cd74bced2a5f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
|
---
title: 'XMLHttpRequest: timeout イベント'
slug: Web/API/XMLHttpRequest/timeout_event
tags:
- Reference
- XHR
- XMLHttpRequest
- timeout
- イベント
- タイムアウト
translation_of: Web/API/XMLHttpRequest/timeout_event
---
<div>{{APIRef}}</div>
<p><code><strong>timeout</strong></code> イベントは、設定された時間が経過し進捗が終了すると発生します。</p>
<table class="properties">
<tbody>
<tr>
<td>バブリング</td>
<td>なし</td>
</tr>
<tr>
<td>キャンセル</td>
<td>不可</td>
</tr>
<tr>
<td>インターフェイス</td>
<td>{{domxref("ProgressEvent")}}</td>
</tr>
<tr>
<td>イベントハンドラープロパティ</td>
<td>{{domxref("XMLHttpRequestEventTarget.ontimeout")}}</td>
</tr>
</tbody>
</table>
<h2 id="Examples" name="Examples">例</h2>
<pre class="brush: js line-numbers language-js">const client = new XMLHttpRequest();
client.open('GET', 'http://www.example.org/example.txt');
client.ontimeout = () => {
console.error('Timeout!!')
};
client.send();</pre>
<p>イベントハンドラーは {{domxref("EventTarget/addEventListener", "addEventListener()")}} メソッドを使用して設定することもできます。</p>
<pre class="brush: js">client.addEventListener('timeout', () => {
console.error("Timeout!!");
});</pre>
<h2 id="Specifications" name="Specifications">仕様書</h2>
<table class="standard-table">
<thead>
<tr>
<th scope="col">仕様書</th>
<th scope="col">状態</th>
<th scope="col">備考</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{SpecName('XMLHttpRequest', '#event-xhr-timeout', 'timeout event')}}</td>
<td>{{Spec2('XMLHttpRequest')}}</td>
<td> </td>
</tr>
</tbody>
</table>
<h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの対応</h2>
<p>{{Compat("api.XMLHttpRequest.timeout_event")}}</p>
<h2 id="See_also" name="See_also">関連情報</h2>
<ul>
<li>{{domxref("XMLHttpRequest")}}</li>
</ul>
|