loadstart

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

io error: No such file or directory (os error 2) (/home/runner/work/yari/yari/mdn/translated-content/files/zh-cn/web/api/xmlhttprequest_api/index.md)

当程序开始加载时,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 只读 DOMString 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.

规范

Specification
XMLHttpRequest Standard
# event-xhr-loadstart
XMLHttpRequest Standard
# handler-xhr-onloadstart

参见