Nuestros voluntarios aún no han traducido este artículo al Español. ¡Únete a nosotros y ayúdanos a traducirlo!
También puedes leer el artículo en English (US).

The onloadstart property of the GlobalEventHandlers mixin is an EventHandler representing the code to be called when the loadstart event is raised (when progress has begun on the loading of a resource.)

Syntax

img.onloadstart = funcRef;

Value

funcRef is the handler function to be called when the resource's loadstart event fires.

Examples

HTML content

<img src="myImage.jpg">

JavaScript content

// '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');
});

Specifications

Specification Status Comment
HTML Living Standard
The definition of 'onloadstart' in that specification.
Living Standard Initial definition

Browser Compatibility

We're converting our compatibility data into a machine-readable JSON format. This compatibility table still uses the old format, because we haven't yet converted the data it contains. Find out how you can help!

Feature Chrome Edge Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support No[2] 20 (12.10240) (Yes)
52 (52)[1]
(Yes) No[2] No[2]
Feature Android Android Webview Edge Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile Chrome for Android
Basic support (Yes) (Yes) 20 (12.10240) (Yes)
52.0 (52)[1]
(Yes) (Yes) ? (Yes)

[1] As of Firefox 52, the loadstart event is now fired on <img> elements.

[2] As of Chrome67, Opera53, Safari 11.1, the loadstart event is NOT fired on <img> elements.

Etiquetas y colaboradores del documento

Colaboradores en esta página: niklasHagner, Sebastianz, chrisdavidmills
Última actualización por: niklasHagner,