diff options
author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
---|---|---|
committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
commit | 33058f2b292b3a581333bdfb21b8f671898c5060 (patch) | |
tree | 51c3e392513ec574331b2d3f85c394445ea803c6 /files/zh-cn/web/api/xmlhttprequesteventtarget/onloadstart | |
parent | 8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff) | |
download | translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2 translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip |
initial commit
Diffstat (limited to 'files/zh-cn/web/api/xmlhttprequesteventtarget/onloadstart')
-rw-r--r-- | files/zh-cn/web/api/xmlhttprequesteventtarget/onloadstart/index.html | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/files/zh-cn/web/api/xmlhttprequesteventtarget/onloadstart/index.html b/files/zh-cn/web/api/xmlhttprequesteventtarget/onloadstart/index.html new file mode 100644 index 0000000000..1501afd132 --- /dev/null +++ b/files/zh-cn/web/api/xmlhttprequesteventtarget/onloadstart/index.html @@ -0,0 +1,54 @@ +--- +title: XMLHttpRequestEventTarget.onloadstart +slug: Web/API/XMLHttpRequestEventTarget/onloadstart +translation_of: Web/API/XMLHttpRequestEventTarget/onloadstart +--- +<div>{{APIRef("XMLHttpRequest")}}</div> + +<p><strong><code>XMLHttpRequestEventTarget.onloadstart</code></strong> 在{{domxref("XMLHttpRequest")}} 开始传送数据时被调用</p> + +<h2 id="Syntax" name="Syntax">语法</h2> + +<pre class="syntaxbox"><em>XMLHttpRequest</em>.onloadstart = <em>callback</em>;</pre> + +<h3 id="值">值</h3> + +<ul> + <li><code><em>callback</em></code> 是开始传送数据时被调用的回调函数</li> +</ul> + +<h2 id="Example" name="Example">示例</h2> + +<pre class="brush: js">var xmlhttp = new XMLHttpRequest(), + method = 'GET', + url = 'https://developer.mozilla.org/'; + +xmlhttp.open(<em>method</em>, <em>url</em>, true); +xmlhttp.onloadstart = function () { + console.log("Download underway"); +}; +xmlhttp.send(); +</pre> + +<h2 id="规范">规范</h2> + +<table class="standard-table"> + <tbody> + <tr> + <th scope="col">规范</th> + <th scope="col">状态</th> + <th scope="col">说明</th> + </tr> + <tr> + <td>{{SpecName('XMLHttpRequest', '#handler-xhr-onloadstart')}}</td> + <td>{{Spec2('XMLHttpRequest')}}</td> + <td>WHATWG 现存标准</td> + </tr> + </tbody> +</table> + +<h2 id="浏览器兼容性">浏览器兼容性</h2> + + + +<p>{{Compat("api.XMLHttpRequestEventTarget.onloadstart")}}</p> |