aboutsummaryrefslogtreecommitdiff
path: root/files/ja/web/api/idbdatabase/name/index.html
blob: 6be29387f39825713ca3df7f1be49c2a6b558424 (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
---
title: IDBDatabase.name
slug: Web/API/IDBDatabase/name
tags:
  - Database
  - IDBDatabase
  - IndexedDB
  - Property
  - Storage
  - name
translation_of: Web/API/IDBDatabase/name
---
<p>{{ APIRef("IDBDatabase") }}</p>
<div>
 <p><code><code>IDBDatabaseインターフェイスの</code>nameプロパティは、接続しているデータベース名を含む</code> {{ domxref("DOMString")}}です。</p>
</div>
<h2 id="構文">構文</h2>
<pre class="brush: js">db.name</pre>
<h3 id="値"></h3>
<p><code>接続しているデータベース名を含む</code>{{ domxref("DOMString")}}</p>
<h2 id="例"></h2>
<p>この例は接続しているデータベースと、DBのversionとnameプロパティを持つ{{domxref("IDBDatabase")}} オブジェクトの結果、そしてログを表示します。完全な例は、<a href="https://github.com/chrisdavidmills/to-do-notifications/tree/gh-pages" style="line-height: 1.5;">To-do Notifications</a><span style="line-height: 1.5;"> app (</span><a href="http://chrisdavidmills.github.io/to-do-notifications/" style="line-height: 1.5;">view example live</a>)<span style="line-height: 1.5;">を見てください。</span></p>
<pre class="brush: js;highlight:[16]">// Let us open our database
var DBOpenRequest = window.indexedDB.open("toDoList", 4);

// these two event handlers act on the database being opened successfully, or not
DBOpenRequest.onerror = function(event) {
  note.innerHTML += '&lt;li&gt;Error loading database.&lt;/li&gt;';
};

DBOpenRequest.onsuccess = function(event) {
  note.innerHTML += '&lt;li&gt;Database initialised.&lt;/li&gt;';

  // store the result of opening the database in the db variable. This is used a lot below
  db = DBOpenRequest.result;

  // This line will log the name of the database, which should be "toDoList"
  console.log(db.name);
};</pre>
<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('IndexedDB', '#widl-IDBDatabase-name', 'name')}}</td>
   <td>{{Spec2('IndexedDB')}}</td>
   <td> </td>
  </tr>
 </tbody>
</table>
<h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザ実装状況</h2>
<div>
 {{CompatibilityTable}}</div>
<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 (WebKit)</th>
   </tr>
   <tr>
    <td>Basic support</td>
    <td>23{{property_prefix("webkit")}}<br>
     24</td>
    <td>10 {{property_prefix("moz")}}<br>
     {{CompatGeckoDesktop("16.0")}}</td>
    <td>10, partial</td>
    <td>15</td>
    <td>7.1</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>Firefox OS</th>
    <th>IE Phone</th>
    <th>Opera Mobile</th>
    <th>Safari Mobile</th>
   </tr>
   <tr>
    <td>Basic support</td>
    <td>4.4</td>
    <td>{{CompatGeckoMobile("22.0")}}</td>
    <td>1.0.1</td>
    <td>10</td>
    <td>22</td>
    <td>{{CompatNo}}</td>
   </tr>
  </tbody>
 </table>
</div>
<h2 id="関連情報">関連情報</h2>
<ul>
 <li><a href="/en-US/docs/Web/API/IndexedDB_API/Using_IndexedDB">Using IndexedDB</a></li>
 <li>Starting transactions: {{domxref("IDBDatabase")}}</li>
 <li>Using transactions: {{domxref("IDBTransaction")}}</li>
 <li>Setting a range of keys: {{domxref("IDBKeyRange")}}</li>
 <li>Retrieving and making changes to your data: {{domxref("IDBObjectStore")}}</li>
 <li>Using cursors: {{domxref("IDBCursor")}}</li>
 <li>Reference example: <a class="external" href="https://github.com/mdn/to-do-notifications/tree/gh-pages">To-do Notifications</a> (<a class="external" href="http://mdn.github.io/to-do-notifications/">view example live</a>.)</li>
</ul>