简体   繁体   English

js语法之间的区别

[英]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 我正在使用jQuery和D3

Both does same function append 这两个不相同的功能追加

In XHTML code, one can use namespaces to distinguish other XML-based languages included in the webpage. 在XHTML代码中,可以使用名称空间来区分网页中包含的其他基于XML的语言。 Here, the namespace "svg" is used before the tag "svg". 在此,名称空间“ svg”在标记“ svg”之前使用。

namespace:tagname

See here 这里

It's not a difference in Javascript syntax. Javascript语法没有区别。 One is appending an svg element, the other is appending a namespaced svg element. 一个是附加一个svg元素,另一个是附加一个命名空间的svg元素。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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