Answer the question
In order to leave comments, you need to log in
Why doesn't SVG render without a dummy update?
Hey!
The question is: why, after generating and adding SVG using JS, is it necessary to update the code fictitiously? It is with SVG that other tags are added as they should. here is an example riveted. in the first case, we generate SVG tags and add them to the div. there is a commented out dummy update at the end. and then the picture is added in the same way. why is the svg not displayed with a commented update, but if you uncomment it, everything is fine?
This example is small but revealing. in fact, I generate a fairly large number of objects, from 2000 to about 10000. And in this case, the dummy update takes a very long time. why? - this is another question, not within the framework of this topic to discuss.
Codepen widget doesn't want to work for some reason
Answer the question
In order to leave comments, you need to log in
They suggested this documentation Namespaces crash course
Everything is well described there. The "Scripting in namespaced XML" section describes which methods to use when working with namespaced elements, in particular SVG. I rewrote my code to fit these specifications - everything works without the need for a fictitious update.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question