aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/api/globaleventhandlers/onloadstart
diff options
context:
space:
mode:
authorPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
committerPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
commit33058f2b292b3a581333bdfb21b8f671898c5060 (patch)
tree51c3e392513ec574331b2d3f85c394445ea803c6 /files/zh-cn/web/api/globaleventhandlers/onloadstart
parent8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff)
downloadtranslated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip
initial commit
Diffstat (limited to 'files/zh-cn/web/api/globaleventhandlers/onloadstart')
-rw-r--r--files/zh-cn/web/api/globaleventhandlers/onloadstart/index.html66
1 files changed, 66 insertions, 0 deletions
diff --git a/files/zh-cn/web/api/globaleventhandlers/onloadstart/index.html b/files/zh-cn/web/api/globaleventhandlers/onloadstart/index.html
new file mode 100644
index 0000000000..33bfbd734a
--- /dev/null
+++ b/files/zh-cn/web/api/globaleventhandlers/onloadstart/index.html
@@ -0,0 +1,66 @@
+---
+title: GlobalEventHandlers.onloadstart
+slug: Web/API/GlobalEventHandlers/onloadstart
+translation_of: Web/API/GlobalEventHandlers/onloadstart
+---
+<div>{{ApiRef}}</div>
+
+<p>TheĀ <strong><code>onloadstart</code></strong> property of the {{domxref("GlobalEventHandlers")}} mixin is an {{domxref("EventHandler")}} representing the code to be called when the {{event("loadstart")}} event is raised (when progress has begun on the loading of a resource.)</p>
+
+<h2 id="Syntax">Syntax</h2>
+
+<pre class="syntaxbox"><var>img</var>.onloadstart = <var>funcRef</var>;
+</pre>
+
+<h3 id="Value">Value</h3>
+
+<p><code>funcRef</code> is the handler function to be called when the resource's <code>loadstart</code> event fires.</p>
+
+<h2 id="Examples">Examples</h2>
+
+<h3 id="HTML_content">HTML content</h3>
+
+<pre class="brush: html">&lt;img src="myImage.jpg"&gt;</pre>
+
+<h3 id="JavaScript_content">JavaScript content</h3>
+
+<pre class="brush: js">// 'loadstart' fires first, then 'load', then 'loadend'
+
+image.addEventListener('load', function(e) {
+ console.log('Image loaded');
+});
+
+image.addEventListener('loadstart', function(e) {
+ console.log('Image load started');
+});
+
+image.addEventListener('loadend', function(e) {
+ console.log('Image load finished');
+});</pre>
+
+<h2 id="Specifications">Specifications</h2>
+
+<table class="standard-table">
+ <thead>
+ <tr>
+ <th scope="col">Specification</th>
+ <th scope="col">Status</th>
+ <th scope="col">Comment</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>{{SpecName("HTML WHATWG", "webappapis.html#handler-onloadstart", "onloadstart")}}</td>
+ <td>{{Spec2("HTML WHATWG")}}</td>
+ <td>Initial definition</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Browser_Compatibility">Browser Compatibility</h2>
+
+<div>
+
+
+<p>{{Compat("api.GlobalEventHandlers.onloadstart")}}</p>
+</div>