弃用
This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the 兼容性表格 at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

非标
此特征是非标准的,且不在标准轨道中。不要在面向 Web 的生产站点中使用它:它不适用于每个用户。实现之间可能存在大的不兼容性,且行为将来可能改变。

ProgressEvent.initProgressEvent() method Initializes an animation event created using the deprecated Document.createEvent("ProgressEvent") 方法。

ProgressEvent created that way are untrusted.

注意: this method has been dropped during the standard process. It has been deprecated and removed from most implementation. Do not use it anymore, use the standard constructor, ProgressEvent() , to create a synthetic ProgressEvent

句法

Progress.initProgressEvent(typeArg, canBubbleArg, cancelableArg, lengthComputable, loaded, total);
					

参数

typeArg
DOMString identifying the specific type of animation event that occurred. The following values are allowed:
含义
loadstart The operation has started.
progress The operation still is in progress.
error The operation failed and didn't complete.
abort The operation was cancelled and didn't complete.
load The operation completed.
loadend The operation stopped.
canBubbleArg
布尔 flag indicating if the event can bubble ( true ) 或不 ( false) .
cancelableArg
布尔 flag indicating if the event associated action can be avoided ( true ) 或不 ( false) .
lengthComputable
布尔 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.
loaded
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.
total
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.

规范

This feature does not exist in any specifications.

浏览器兼容性

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. 更新 GitHub 上的兼容性数据
桌面 移动
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
initProgressEvent 弃用 非标 Chrome 1 — 17 Edge 12 — 79 Firefox 3.5 — 22 IE 10 Opera ? — 15 Safari ? — ? WebView Android No Chrome Android ? — ? Firefox Android 4 — 22 Opera Android ? — 14 Safari iOS ? — ? Samsung Internet Android No

图例

完整支持

完整支持

不支持

不支持

非标。预期跨浏览器支持较差。

非标。预期跨浏览器支持较差。

弃用。不要用于新网站。

弃用。不要用于新网站。

另请参阅

元数据

  • 最后修改: