I'm trying to load an SVG file from a CDN using this code:
<object type="image/svg+xml" data="https://cdn.mywebsite.com/path/file.svg"></object>
The SVG file is in an S3 bucket served by CloudFront CDN. It's content-type is set to "image/svg+xml". To the best of my knowledge, my S3 bucket and CDN are configured to allow CORS requests from any origin.
If I look at the browser Network tab, the HTTP GET request succeeds and it receives the SVG data in response. However, the document data is not inserted into the DOM, so it doesn't display and cannot be accessed by JavaScript.
How can I embed the SVG document into my webpage so that it becomes an accessible part of the DOM?