IDBVersionChangeRequest

警告: The latest specification does not include this interface anymore as the IDBDatabase.setVersion() method has been removed. See the compatibility table for version details.
The new way to do it is to use the IDBOpenDBRequest interface which has now the onblocked handler and the newly needed onupgradeneeded one.

IDBVersionChangeRequest interface the IndexedDB API represents a request to change the version of a database. It is used only by the setVersion() method of IDBDatabase .

方法

Inherits from: IDBRequest

IDBVersionChangeRequest.setVersion
Updates the version of the database. Returns immediately and runs a versionchange transaction on the connected database in a separate thread.

属性

属性 Type 描述
onblocked Function The event handler for the blocked event.

浏览器兼容性

更新 GitHub 上的兼容性数据
Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
IDBVersionChangeRequest
弃用 非标
Chrome 12 — 23
Prefixed
不支持 12 — 23
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Edge ? Firefox No IE No Opera No Safari No WebView Android No Chrome Android No Firefox Android No Opera Android No Safari iOS No Samsung Internet Android No
setVersion
弃用 非标
Chrome No Edge No Firefox No IE No Opera No Safari No WebView Android No Chrome Android No Firefox Android No Opera Android No Safari iOS No Samsung Internet Android No

图例

不支持
不支持
兼容性未知
兼容性未知
非标。预期跨浏览器支持较差。
非标。预期跨浏览器支持较差。
弃用。不要用于新网站。
弃用。不要用于新网站。
要求使用供应商前缀或不同名称。
要求使用供应商前缀或不同名称。