html - SVG added to DOM using javascript is not visible. -


i have valid svg file verified opening in image viewer.

i tried adding svg html file using javascript code

d3.xml("assets/abc.svg", function(xml) {    document.body.appendchild(xml.documentelement); }); 

i check html source , can see svg added in html. svg not visible on page. idea reason?

note :

  1. d3 working fine.
  2. the svg valid.
  3. the svg getting added dom structure within body.'
  4. its not visible in both chrome , firefox.

works ok me in ie/ff/ch. have valid svg, following in root svg:

<svg    xmlns:svg="http://www.w3.org/2000/svg"    xmlns="http://www.w3.org/2000/svg" ...> 

if have namespace, problem svg not formed correctly. or possibly, svg not viewable i.e. display="none" or viewbox tiny


Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -