SVG with external images doesn't load them when embedded with <img> tag in browsers

Posted by mat3001 on Stack Overflow See other posts from Stack Overflow or by mat3001
Published on 2010-05-01T11:02:44Z Indexed on 2010/05/01 11:07 UTC
Read the original article Hit count: 336

Filed under:
|

I made the following observation:

If I create an svg image that references an external raster image via "xlink:href" and try to load the svg in browsers, the external images are only shown if I use the tag, but not when using the tag.

Rendering with the tag is quite slow and not as clean as using the img tag for images so I was wondering if there's a way to make it work through the tag.
At first I thought it doesn't work because of a same origin policy, but even if the referenced image is in the same directory and I reference it through its name only, it wont load.

Any ideas?

© Stack Overflow or respective owner

Related posts about svg

Related posts about same-origin-policy