Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. IDBVersionChangeEvent
  4. IDBVersionChangeEvent()

IDBVersionChangeEvent: IDBVersionChangeEvent() constructor

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since ⁨January 2020⁩.

Secure context: This feature is available only insecure contexts (HTTPS), in some or allsupporting browsers.

TheIDBVersionChangeEvent() constructorcreates a newIDBVersionChangeEvent object, which is used to representwhen a version of the database has changed, as a result of theonupgradeneeded event handler.

Syntax

js
new IDBVersionChangeEvent(type)new IDBVersionChangeEvent(type, options)

Parameters

type

A string with the name of the event.It is case-sensitive and browsers set it toversionchange,success, orblocked.

optionsOptional

An object that,in addition of the properties defined inEvent(), can have the following properties:

oldVersionOptional

A number representing the previous version of the database. It defaults to0.

newVersionOptional

An unsigned long representing the new version of the database,ornull if the database is being deleted. It defaults isnull.

Return value

A newIDBVersionChangeEvent object.

Examples

For a full working example, see ourTo-do Notifications app (view example live).

Specifications

Specification
Indexed Database API 3.0
# dom-idbversionchangeevent-idbversionchangeevent

Browser compatibility

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp