dom / latest / progressevent / progressevent.html /

ProgressEvent()

The ProgressEvent() constructor returns a newly created ProgressEvent, representing the current completion of a long process.

Syntax

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 the ProgressEvent. 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 to false.

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 and ProgressEvent.total. When downloading a resource using HTTP, this only represent the part of the content itself, not headers and other overhead. It defaults to 0.

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 to 0.

Specifications

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
ProgressEvent
16
14
18
No
15
6
4.4
18
18
14
6
1.0

See also

© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/ProgressEvent/ProgressEvent