Hello. Given: - svg sprite
<svg style="display: none;" width="0" height="0" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <defs> <!-- набор <symbol> --> </defs> </svg> - script that using ajax inline this sprite in html
<script> var ajax = new XMLHttpRequest(); ajax.open("GET", "assets/template/images/sprite.svg", true); ajax.send(); ajax.onload = function(e) { var div = document.createElement("div"); div.innerHTML = ajax.responseText; document.body.insertBefore(div, document.body.childNodes[0]); } </script> <svg class="icon icon-tools" ><use xlink:href="#icon-tools"/></svg> Problem: in all browsers except IE icons from the sprite are pulled up only on the first page. On the inside is empty.
Thanks for any advice or help.
"assets/template/images/sprite.svg"an absolute address, and not a relative one is worth asking? - Visman 4:08 pm