I don't really understand how does createElementNS works. For example:
svg = "http://www.w3.org/2000/svg";
group = document.createElementNS(svg,"g");
Does this connect to the specified namespace and gets the definitions for the g element?
If so... if placed inside a for there will be some kind of request to the specified url?
Is there another way to create a g element? One that does not require online connection?
I don't think so because I don't see any requests going there but still... is a bit ambiguous.
The reason why I'm asking is that something is greatly slowing my script down and I don't know exactly what.
createElementNS() Creates an element with the specified namespace URI and qualified name. To create an element without specifying a namespace URI, use the createElement() method.
The namespace URI is what allows us to identify uniquely the namespace. It is also called the namespace name. If you use an URL, you will take advantage of the uniqueness of domain names in the domain name system (DNS).
Does this connect to the specified namespace and gets the definitions for the g element?
No. You can't "connect" to a namespace. http://www.w3.org/2000/svg
is a unique identifier for the namespace, but namespaces are not URLs. The software handing the DOM needs to understand SVG (and will have the namespace mapped internally to its understanding of it).
The URL http://www.w3.org/2000/svg
is a document that tells readers where to find more information about SVG, but that is just the authors being helpful, there is no programatic significance of a document existing there.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With