In my chrome extension, I am trying to display an SVG sprite, yet it is not displaying the content. I am not seeing any errors in the console and have tried both local and online. I have also tried using an IMG tag to no avail. All other advice I have found talks about constructing the shapes.
var svg = div.appendChild(document.createElement( "svg" ));
svg .classList.add( "actionButtonImage" );
var use = svg.appendChild(document.createElement( "use" ));
use .setAttribute( "xmlns:xlink"," http://www.w3.org/1999/xlink" );
use .setAttribute( "xlink:href", href );
EDIT: I am not looking to make the vectors in page, I am using external SVG sprites! And have spen a day and half researching this!
So far I have this to no avail
var svg = div.appendChild(document.createElementNS( "http://www.w3.org/2000/svg", "svg" ));
svg .classList.add("actionButtonImage");
var use = svg.appendChild(document.createElementNS( "http://www.w3.org/1999/xlink", "use" ));
use .setAttributeNS("http://www.w3.org/1999/xlink","href",href);