blob: 27e406ed7c44206d8a20016729db3a8f17448fbb (
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
|
---
title: ErrorEvent
slug: Web/API/ErrorEvent
translation_of: Web/API/ErrorEvent
---
<p>{{APIRef("HTML DOM")}}</p>
<p><strong><code>ErrorEvent</code></strong> 介面是用來提供程式碼或是檔案的錯誤訊息的事件。</p>
<h2 id="Properties">Properties</h2>
<p><em>此介面繼承了其父 {{domxref("Event")}} 的 properties 。</em></p>
<dl>
<dt>{{domxref("ErrorEvent.message")}} {{readonlyInline}}</dt>
<dd>一 {{domxref("DOMString")}} 提供具可讀性的關於問題的錯誤訊息。</dd>
<dt>{{domxref("ErrorEvent.filename")}} {{readonlyInline}}</dt>
<dd>一 {{domxref("DOMString")}} ,為發生錯誤的程式碼檔案的檔名。</dd>
<dt>{{domxref("ErrorEvent.lineno")}} {{readonlyInline}}</dt>
<dd>一 <code>整數</code> ,為發生問題的程式的行數。</dd>
<dt>{{domxref("ErrorEvent.colno")}} {{readonlyInline}}</dt>
<dd>一 <code>整數</code> ,為發生問題的程式的欄數。</dd>
<dt>{{domxref("ErrorEvent.error")}} {{readonlyInline}} {{experimental_inline}}</dt>
<dd>一個參與該事件的 JavaScript <code>Object</code> 。</dd>
</dl>
<h2 id="Constructor">Constructor</h2>
<dl>
<dt>{{domxref("ErrorEvent.ErrorEvent", "ErrorEvent()")}}</dt>
<dd>建立一 <code>ErrorEvent</code> 事件,其包含提供的參數。</dd>
</dl>
<h2 id="Methods">Methods</h2>
<p><em>此介面繼承了其父 {{domxref("Event")}} 的 methods。</em></p>
<h2 id="Specifications">Specifications</h2>
<table class="standard-table">
<thead>
<tr>
<th scope="col">Specification</th>
<th scope="col">Status</th>
<th scope="col">Comment</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{ SpecName('HTML WHATWG', 'webappapis.html#the-errorevent-interface', 'ErrorEvent') }}</td>
<td>{{ Spec2('HTML WHATWG') }}</td>
<td>追加 <code>error</code> propriety 以及 constructor 的第5個the 5th 參數。</td>
</tr>
<tr>
<td>{{ SpecName('HTML5 W3C', 'webappapis.html#the-errorevent-interface', 'ErrorEvent') }}</td>
<td>{{ Spec2('HTML5 W3C') }}</td>
<td>初始定義。</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>Firefox (Gecko)</th>
<th>Internet Explorer</th>
<th>Opera</th>
<th>Safari</th>
</tr>
<tr>
<td>Basic support</td>
<td>{{CompatVersionUnknown}}</td>
<td>{{CompatVersionUnknown}}</td>
<td>{{CompatUnknown}}</td>
<td>{{CompatVersionUnknown}}</td>
<td>{{CompatVersionUnknown}}</td>
</tr>
<tr>
<td><code>colno</code> property and 4th argument to constructor</td>
<td>{{CompatVersionUnknown}}</td>
<td>{{CompatVersionUnknown}}</td>
<td>{{CompatUnknown}}</td>
<td>{{CompatUnknown}}</td>
<td>{{CompatUnknown}}</td>
</tr>
<tr>
<td><code>error</code> property and 5th argument to constructor</td>
<td>{{CompatVersionUnknown}}</td>
<td>{{CompatVersionUnknown}}</td>
<td>{{CompatNo}}</td>
<td>{{CompatNo}}</td>
<td>{{CompatNo}}</td>
</tr>
</tbody>
</table>
</div>
<div id="compat-mobile">
<table class="compat-table">
<tbody>
<tr>
<th>Feature</th>
<th>Android</th>
<th>Firefox Mobile (Gecko)</th>
<th>IE Mobile</th>
<th>Opera Mobile</th>
<th>Safari Mobile</th>
</tr>
<tr>
<td>Basic support</td>
<td>{{CompatVersionUnknown}}</td>
<td>{{CompatVersionUnknown}}</td>
<td>{{CompatUnknown}}</td>
<td>{{CompatVersionUnknown}}</td>
<td>{{CompatVersionUnknown}}</td>
</tr>
<tr>
<td><code>colno</code> property and 4th argument to constructor</td>
<td>{{CompatUnknown}}</td>
<td>{{CompatNo}}</td>
<td>{{CompatUnknown}}</td>
<td>{{CompatUnknown}}</td>
<td>{{CompatUnknown}}</td>
</tr>
<tr>
<td><code>error</code> property and 5th argument to constructor</td>
<td>{{CompatNo}}</td>
<td>{{CompatNo}}</td>
<td>{{CompatNo}}</td>
<td>{{CompatNo}}</td>
<td>{{CompatNo}}</td>
</tr>
</tbody>
</table>
</div>
<h2 id="延伸閱讀">延伸閱讀</h2>
<ul>
<li><a href="/en-US/docs/Web/Guide/Performance/Using_web_workers" title="/en-US/docs/Web/Guide/Performance/Using_web_workers">Using web workers</a>, most likely objects to raise such an event</li>
</ul>
|