# class Request

#### package js.html.idb

#### extends EventTarget

#### extended by OpenDBRequest

Available on HTML5

The request object does not initially contain any information about the result of the operation, but once information becomes available, an event is fired on the request, and the information becomes available through the properties of the `IDBRequest` instance.

Documentation IDBRequest by Mozilla Contributors, licensed under CC-BY-SA 2.5.

See:

https://developer.mozilla.org/en-US/docs/Web/API/IDBRequest

### Variables

###

`read onlyerror:DOMError`

Returns an error in the event of an unsuccessful request, indicating what went wrong.

###

`onerror:Function`

The event handler for the error event.

###

`onsuccess:Function`

The event handler for the success event.

###

`read onlyreadyState:RequestReadyState`

The state of the request. Every request starts in the `pending` state. The state changes to `done` when the request completes successfully or when an error occurs.

###

`read onlyresult:Dynamic`

Returns the result of the request. If the the request failed and the result is not available, an InvalidStateError exception is thrown.

###

`read onlysource:EitherType<ObjectStore, EitherType<Index, Cursor>>`

The source of the request, such as an `IDBIndex` or an `IDBObjectStore`. If no source exists (such as when calling `IDBFactory.open`), it returns null.

###

`read onlytransaction:Transaction`

The transaction for the request. This property can be null for certain requests, for example those returned from `IDBFactory.open` unless an upgrade is needed. (You're just connecting to a database, so there is no transaction to return).

### Inherited Variables

### Inherited Methods

#### Defined by EventTarget

###

`addEventListener (type:String, listener:Function, capture:Bool = false):Void`

`addEventListener (type:String, listener:EventListener, capture:Bool = false, ?wantsUntrusted:Bool):Void`

Throws:

`null` | DOMError

###

`dispatchEvent (event:Event):Bool`

Throws:

`null` | DOMError

###

`removeEventListener (type:String, listener:Function, capture:Bool = false):Void`

`removeEventListener (type:String, listener:EventListener, capture:Bool = false):Void`

Throws:

`null` | DOMError