aboutsummaryrefslogtreecommitdiff
path: root/files/ja/web/api/domrequest/index.html
blob: 0e6ef466a390d022adc89f00645dd0d8e5291481 (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
---
title: DOMRequest
slug: Web/API/DOMRequest
tags:
  - DOM
  - Gecko DOM Reference
translation_of: Archive/B2G_OS/API/DOMRequest
---
<div>
 {{ApiRef}}</div>
<p><code>DOMRequest</code> オブジェクトは、進行中の操作を表します。操作の完了時に呼び出されるコールバックと、操作結果への参照を提供します。 進行中の操作を開始する DOM メソッドは、その操作の進行状況の監視に使用できる <code>DOMRequest</code> オブジェクトを返すことがあります。</p>
<h2 id="Attributes" name="Attributes">属性</h2>
<dl>
 <dt>
  {{ domxref("DOMRequest.onsuccess") }}</dt>
 <dd>
  <code>DOMRequest</code> によって表される、操作の完了時に呼び出されるコールバックハンドラ</dd>
 <dt>
  {{ domxref("DOMRequest.onerror") }}</dt>
 <dd>
  操作の処理中にエラーが発生したときに呼び出されるコールバックハンドラ</dd>
 <dt>
  {{ domxref("DOMRequest.readyState") }}</dt>
 <dd>
  操作が完了しているか否かを示す <a href="/ja/docs/JavaScript/Reference/Global_Objects/String" title="JavaScript/Reference/Global_Objects/String"><code>string</code></a>。値は "done" もしくは "pending" の何れか。</dd>
 <dt>
  {{ domxref("DOMRequest.result") }}</dt>
 <dd>
  操作結果</dd>
 <dt>
  {{ domxref("DOMRequest.error") }}</dt>
 <dd>
  エラー情報(※存在する場合)</dd>
</dl>
<h2 id="Example" name="Example"></h2>
<p>{{domxref("App")}}<code>onsuccess</code><code>onerror</code><code>result</code><code>error</code> の使用例</p>
<pre class="brush: js">var pending = navigator.mozApps.install(manifestUrl);

pending.onsuccess = function () {
  // Save the App object that is returned
  var appRecord = this.result;
  alert('Installation successful!')
};

pending.onerror = function () {
  // Display the name of the error
  alert('Install failed, error: ' + this.error.name);
};</pre>
<h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザ実装状況</h2>
<p>{{ CompatibilityTable }}</p>
<div id="compat-desktop">
 <table class="compat-table">
  <tbody>
   <tr>
    <th>機能</th>
    <th>Chrome</th>
    <th>Firefox (Gecko)</th>
    <th>Internet Explorer</th>
    <th>Opera</th>
    <th>Safari</th>
   </tr>
   <tr>
    <td>基本サポート</td>
    <td>{{ CompatUnknown }}</td>
    <td>{{ CompatGeckoDesktop("13.0") }}</td>
    <td>{{ CompatUnknown }}</td>
    <td>{{ CompatUnknown }}</td>
    <td>{{ CompatUnknown }}</td>
   </tr>
  </tbody>
 </table>
</div>
<div id="compat-mobile">
 <table class="compat-table">
  <tbody>
   <tr>
    <th>機能</th>
    <th>Android</th>
    <th>Chrome for Android</th>
    <th>Firefox Mobile (Gecko)</th>
    <th>IE Mobile</th>
    <th>Opera Mobile</th>
    <th>Safari Mobile</th>
   </tr>
   <tr>
    <td>基本サポート</td>
    <td>{{ CompatUnknown }}</td>
    <td>{{ CompatUnknown }}</td>
    <td>{{ CompatGeckoMobile("13.0") }}</td>
    <td>{{ CompatUnknown }}</td>
    <td>{{ CompatUnknown }}</td>
    <td>{{ CompatUnknown }}</td>
   </tr>
  </tbody>
 </table>
</div>
<h2 id="Specification" name="Specification">仕様</h2>
<p>どの仕様書にも含まれていません。</p>
<h2 id="See_also" name="See_also">関連情報</h2>
<ul>
 <li><a href="/ja/docs/DOM/SmsRequest">SmsRequest</a> {{non-standard_inline}} ※現・<code>DOMRequest</code></li>
</ul>