如何在 e4x 中添加另一个同级元素?

发布于 2024-09-19 18:50:36 字数 244 浏览 5 评论 0原文

如果我想创建:

<foo>
  <bar>example1</bar>
  <bar>example2</bar>
</foo>

使用 e4x,并且我已经有了:

foo.bar = <bar>example1</bar>

如何添加附加栏标记?

If I want to create:

<foo>
  <bar>example1</bar>
  <bar>example2</bar>
</foo>

using e4x, and I already have:

foo.bar = <bar>example1</bar>

How do I add the additional bar tag?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

醉态萌生 2024-09-26 18:50:36

您可以编写另一个文字

foo += <bar>example3</bar> ;

或者使用相关方法:http://www.ibm.com/developerworks/library/x-javascript4x.html(表 1),

var addition = <bar>example3</bar>
foo.insertChildAfter(foo.bar[1],addition) ;

HTH

You either write another literal,

foo += <bar>example3</bar> ;

or you use the relevant methods: http://www.ibm.com/developerworks/library/x-javascript4x.html (Table-1),

var addition = <bar>example3</bar>
foo.insertChildAfter(foo.bar[1],addition) ;

HTH

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文