Safari not calling `onerror` for <object>s?

Viewed 24

I need to know if an SVG failed to load in an <object> element. This code works in Chrome and FF but not in Safari. – Why?

<!DOCTYPE html>
<html lang="en">
    <body>
        <object id="object" type="image/svg+xml"></object>
        <script>
            const elem = document.querySelector('#object');
            elem.onerror = () => console.log('here');
            elem.data = 'https://www.google.com/does-not-exist.svg';
        </script>
    </body>
</html>
0 Answers
Related