The ProgressEvent()
constructor returns a newly created ProgressEvent
, representing the current completion of a long process.
Syntax
progressEvent = new ProgressEvent(type, {lengthComputable: aBooleanValue, loaded: aNumber, total: aNumber});
Arguments
The ProgressEvent()
constructor also inherits arguments from Event()
.
- type
- Is a
DOMString
representing the name of the type of theProgressEvent
. It is case-sensitive. lengthComputable
Optional- Is a
Boolean
flag indicating if the total work to be done, and the amount of work already done, by the underlying process is calculable. In other words, it tells if the progress is measurable or not. It defaults tofalse
. loaded
Optional- Is an
unsigned long long
representing the amount of work already performed by the underlying process. The ratio of work done can be calculated with the property andProgressEvent.total
. When downloading a resource using HTTP, this only represent the part of the content itself, not headers and other overhead. It defaults to0
. total
Optional- Is an
unsigned long long
representing the total amount of work that the underlying process is in the progress of performing. When downloading a resource using HTTP, this only represent the content itself, not headers and other overhead. It defaults to0
.
Specifications
Specification | Status | Comment |
XMLHttpRequestThe definition of 'ProgressEvent()' in that specification. | Living Standard |
Browser compatibility
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Update compatibility data on GitHub
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
ProgressEvent() constructor
|
Chrome
Full support Yes |
Edge
Full support ≤79 |
Firefox
Full support 22 |
IE
No support No |
Opera
Full support Yes |
Safari
Full support Yes |
WebView Android
Full support Yes |
Chrome Android
Full support Yes |
Firefox Android
Full support 22 |
Opera Android
Full support Yes |
Safari iOS
Full support Yes |
Samsung Internet Android
Full support Yes |
Legend
- Full support
- Full support
- No support
- No support
See also
- The
ProgressEvent
interface it belongs to.
ProgressEvent() by Mozilla Contributors is licensed under CC-BY-SA 2.5.