What is the meaning of this?
.append(\"svg:svg\")
I saw it in HTML and in D3 code. Does it add plugin of SVG?
In XHTML code, one can use namespaces to distinguish other XML-based languages included in the webpage. Here, the namespace "svg" is used before the tag "svg".
namespace:tagname
This can be useful in case two tags (for example, in XHTML and SVG) have the same name and you want to exactly specify which one you refer to. The tags can be specified with the xmlns
attribute. As you know, XHTML documents start with
you may specify the prefix as
and then you'll use
Similarily you can use
instead of just when including your svg graphic. Then all svg tags will start with the
svgprefix
prefix. However if you have child SVG nodes, they will also need this xmlns
attribute to be defined. In such a case, defining the prefix will probably be easier.