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 StandardThe definition of 'onloadstart' in that specification. | Living Standard | Initial definition |
Browser compatibility
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Update compatibility data on GitHub
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
onloadstart
|
Chrome Full support Yes Full support Yes Notes' The |
Edge
Full support 12 |
Firefox
Full support 52 |
IE
Full support Yes |
Opera Full support Yes Full support Yes Notes' The |
Safari Full support Yes Full support Yes Notes' The |
WebView Android Full support Yes Full support Yes Notes' The |
Chrome Android Full support Yes Full support Yes Notes' The |
Firefox Android
Full support 52 |
Opera Android Full support Yes Full support Yes Notes' The |
Safari iOS Full support Yes Full support Yes Notes' The |
Samsung Internet Android Full support Yes Full support Yes Notes' The |
Legend
- Full support
- Full support
- See implementation notes.'
- See implementation notes.
GlobalEventHandlers.onloadstart by Mozilla Contributors is licensed under CC-BY-SA 2.5.