From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/ja/web/api/idbdatabase/close/index.html | 131 ++++++++++++++++++++++++++ 1 file changed, 131 insertions(+) create mode 100644 files/ja/web/api/idbdatabase/close/index.html (limited to 'files/ja/web/api/idbdatabase/close') diff --git a/files/ja/web/api/idbdatabase/close/index.html b/files/ja/web/api/idbdatabase/close/index.html new file mode 100644 index 0000000000..12a2046a30 --- /dev/null +++ b/files/ja/web/api/idbdatabase/close/index.html @@ -0,0 +1,131 @@ +--- +title: IDBDatabase.close +slug: Web/API/IDBDatabase/close +tags: + - API + - Database + - IDBDatabase + - IndexedDB + - Method + - Storage + - close +translation_of: Web/API/IDBDatabase/close +--- +

{{ APIRef("IDBDatabase") }}

+ +
+

{{domxref("IDBDatabase")}}インターフェイスのclose()は、ただちに戻り、別スレッドで接続を閉じます。

+
+ +

実際には、この接続を使用していて生成されたすべてのトランザクションが完了するまで、接続は閉じられません。一度このメソッドが呼び出されたら、この接続では、新しいトランザクションを生成することはできません。終了処理がペンディングされている場合は、トランザクションを生成するメソッドは、例外を発生させます。

+ +

構文

+ +
db.close();
+ +

戻り値

+ +

Void。

+ +

+ +
// 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 += '<li>Error loading database.</li>';
+  };
+
+  DBOpenRequest.onsuccess = function(event) {
+    note.innerHTML += '<li>Database initialised.</li>';
+
+    // store the result of opening the database in the db variable.
+    db = DBOpenRequest.result;
+
+    // now let's close the database again!
+    db.close();
+  }
+ +

仕様

+ + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('IndexedDB', '#widl-IDBDatabase-close-void', 'close()')}}{{Spec2('IndexedDB')}} 
+ +

ブラウザ実装状況

+ +
{{CompatibilityTable}}
+ +
+ + + + + + + + + + + + + + + + + + + +
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari (WebKit)
Basic support23{{property_prefix("webkit")}}
+ 24
10 {{property_prefix("moz")}}
+ {{CompatGeckoDesktop("16.0")}}
10, partial157.1
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
FeatureAndroidFirefox Mobile (Gecko)Firefox OSIE PhoneOpera MobileSafari Mobile
Basic support4.4{{CompatGeckoMobile("22.0")}}1.0.11022{{CompatNo}}
+
+ +

関連項目

+ + -- cgit v1.2.3-54-g00ecf