Closed izeau closed 7 years ago
This is also happening to me when serving the SVG from the same domain.
If you're always going to use polyfill: true
, you can leverage the attributeName option which allows you to use a data attribute on the use
element instead of an xlink:href
value (the reason behind 2 requests).
svg4everybody({
attributeName: 'data-href',
polyfill: true
});
<svg role="img" title="Twitter">
<use data-href="map.svg#twitter"/>
</svg>
This works wonders! It is an undocumented feature though, will it stay?
Closed by #155
I'm assuming it will stay, it was added very recently which is why it's undocumented.
Hey guys,
We want to put our SVG spritesheet in a CDN for faster delivery, and as such we need to be able to load it via AJAX using the
polyfill: true
option. This works, however, the SVG is loaded twice (once from the<use>
tags in the HTML, the second time via the polyfill). Is there any way to prevent the first load?Cheers