aboutsummaryrefslogtreecommitdiff
path: root/files/zh-tw/web/api/xmlhttprequesteventtarget/index.html
blob: 41045ab17fe57dfe6bae57d36abbc287f033c4a8 (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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
---
title: XMLHttpRequestEventTarget
slug: Web/API/XMLHttpRequestEventTarget
translation_of: Web/API/XMLHttpRequestEventTarget
---
<p>{{APIRef("XMLHttpRequest")}}</p>

<p><code>XMLHttpRequestEventTarget</code> 介面描述了一個 {{ domxref("XMLHttpRequest") }} 物件實體當中,所有可註冊事件處理器的屬性。</p>

<p>{{InheritanceDiagram}}</p>

<h2 id="屬性">屬性</h2>

<dl>
 <dt>{{ domxref("XMLHttpRequestEventTarget.onabort") }}</dt>
 <dd>Contains the function to call when a request is aborted and the {{event('abort')}} event is received by this object.</dd>
 <dt>{{ domxref("XMLHttpRequestEventTarget.onerror") }}</dt>
 <dd>Contains the function to call when a request encounters an error and the {{event('error')}} event is received by this object.</dd>
 <dt>{{ domxref("XMLHttpRequestEventTarget.onload") }}</dt>
 <dd>Contains the function to call when an HTTP request returns after successfully fetching content and the {{event('load')}} event is received by this object.</dd>
 <dt>{{ domxref("XMLHttpRequestEventTarget.onloadstart") }}</dt>
 <dd>Contains the function that gets called when the HTTP request first begins loading data and the {{event('loadstart')}} event is received by this object.</dd>
 <dt>{{ domxref("XMLHttpRequestEventTarget.onprogress") }}</dt>
 <dd>Contains the function that is called periodically with information about the progress of the request and the {{event('progress')}} event is received by this object.</dd>
 <dt>{{ domxref("XMLHttpRequestEventTarget.ontimeout") }}</dt>
 <dd>Contains the function that is called if the event times out and the {{event("timeout")}} event is received by this object; this only happens if a timeout has been previously established by setting the value of the <code>XMLHttpRequest</code> object's <code>timeout</code> attribute.</dd>
 <dt>{{ domxref("XMLHttpRequestEventTarget.onloadend") }}</dt>
 <dd>Contains the function that is called when the load is completed, even if the request failed, and the {{event('loadend')}} event is received by this object.</dd>
</dl>

<h2 id="規範">規範</h2>

<table class="standard-table">
 <tbody>
  <tr>
   <th scope="col">Specification</th>
   <th scope="col">Status</th>
   <th scope="col">Comment</th>
  </tr>
  <tr>
   <td>{{SpecName('XMLHttpRequest')}}</td>
   <td>{{Spec2('XMLHttpRequest')}}</td>
   <td>WHATWG living standard</td>
  </tr>
 </tbody>
</table>

<h2 id="瀏覽器相容性">瀏覽器相容性</h2>

<p>{{CompatibilityTable}}</p>

<div id="compat-desktop">
<table class="compat-table">
 <tbody>
  <tr>
   <th>Feature</th>
   <th>Chrome</th>
   <th>Edge</th>
   <th>Firefox (Gecko)</th>
   <th>Internet Explorer</th>
   <th>Opera</th>
   <th>Safari (WebKit)</th>
  </tr>
  <tr>
   <td>Basic support</td>
   <td>1</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatGeckoDesktop("1.0")}}</td>
   <td>7</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>1.2</td>
  </tr>
 </tbody>
</table>
</div>

<div id="compat-mobile">
<table class="compat-table">
 <tbody>
  <tr>
   <th>Feature</th>
   <th>Android</th>
   <th>Chrome for Android</th>
   <th>Edge</th>
   <th>Firefox Mobile (Gecko)</th>
   <th>IE Phone</th>
   <th>Opera Mobile</th>
   <th>Safari Mobile</th>
  </tr>
  <tr>
   <td>Basic support</td>
   <td>{{CompatUnknown}}</td>
   <td>1.0</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
  </tr>
 </tbody>
</table>
</div>

<p> </p>

<h2 id="參見">參見</h2>

<ul>
 <li>{{ domxref("XMLHttpRequest") }}</li>
 <li><a href="/zh-TW/DOM/XMLHttpRequest/Using_XMLHttpRequest" title="Using XMLHttpRequest">Using XMLHttpRequest</a></li>
</ul>