简体   繁体   中英

Difference between js syntax

what are the differences in syntax between

.append("svg")

vs.

.append("svg:svg")

what are the pros and cons and what do they imply?

I am using jQuery and D3

Both does same function append

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

See here

It's not a difference in Javascript syntax. One is appending an svg element, the other is appending a namespaced svg element.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM