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
DOMStringrepresenting the name of the type of theProgressEvent. It is case-sensitive. lengthComputableOptional- Is a
Booleanflag 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. loadedOptional- Is an
unsigned long longrepresenting 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. totalOptional- Is an
unsigned long longrepresenting 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 |
|---|---|---|
| Progress Events The definition of 'ProgressEvent()' in that specification. |
Candidate Recommendation | Initial definition. |
Browser compatibility
| Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
|---|---|---|---|---|---|
| Basic support | (Yes) | 22.0 (22.0) | Not supported | Not supported | Not supported |
| Feature | Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
|---|---|---|---|---|---|
| Basic support | Not supported | 22.0 (22.0) | Not supported | Not supported | Not supported |
See also
- The
ProgressEventinterface it belongs to.