The load
event fires on an SVGElement
when it is loaded in the browser, e.g. in the DOM in the case of an embedded <svg>
. It is basically the same as the standard load
DOM event.
This event is not cancelable and does not bubble.
The load
event fires on an SVGElement
when it is loaded in the browser, e.g. in the DOM in the case of an embedded <svg>
. It is basically the same as the standard load
DOM event.
This event is not cancelable and does not bubble.
Use the event name in methods like addEventListener()
, or set an event handler property.
js
addEventListener("load", (event) => {}); onload = (event) => {};
A generic Event
.
js
svgElem.addEventListener("load", () => { console.log("SVG loaded."); });
Specification |
---|
Scalable Vector Graphics (SVG) 2 # LoadEvent |
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | |
load_event |
1 | 12 | 9 | ≤12.1 | 3 | ≤37 | 18 | ≤12.1 | 1 | 1.0 |
© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/SVGElement/load_event