XMLHttpRequest API
当程序开始加载时,loadstart 事件将被触发。这个事件可以被 XMLHttpRequest 调用,也适用于 img 和 video 元素。
基本信息
- 规范文档
- : Progress
- 接口
- : ProgressEvent
- 冒泡
- : No
- 可取消
- : No
- 目标
- : Element
- 默认动作
- : None
属性
| Property | Type | Description |
|---|---|---|
target |
EventTarget | The event target (the topmost target in the DOM tree). |
type |
String | The type of event. |
bubbles |
Boolean | Whether the event normally bubbles or not. |
cancelable |
Boolean | Whether the event is cancellable or not. |
lengthComputable |
Boolean | Specifies whether or not the total size of the transfer is known. Read only. |
loaded |
unsigned long (long) | The number of bytes transferred since the beginning of the operation. This doesn't include headers and other overhead, but only the content itself. Read only. |
total |
unsigned long (long) | The total number of bytes of content that will be transferred during the operation. If the total size is unknown, this value is zero. Read only. |
规范
参见
- 相关事件:XMLHttpRequest/loadend_event、XMLHttpRequest/load_event、XMLHttpRequest/progress_event、XMLHttpRequest/error_event、XMLHttpRequest/abort_event
- 监测进度
来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。
