SVG 1.1 Javascript参考

编程入门 行业动态 更新时间:2024-10-24 01:50:50
本文介绍了SVG 1.1 Javascript参考的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我注意到SVG中没有 document.write 。

I have noticed that there is no document.write in SVG.

目前我正在寻找类似的功能。

Currently I'm looking for a similar function .

Unfortunatley我找不到列出的网站与SVG DOM相关或支持的所有功能(例如与文档对象相关)。

Unfortunatley I couldn't find a website that lists all the functions related or supported by the SVG DOM (for eg. related to the document object).

你知道任何在线资源,我可以找到SVG文档,特别是与scriptin相关的东西(类似于JAVADOC)。

Do you know any online resources where I can find SVG documentation, especially related to scriptin (something similar to a JAVADOC).

推荐答案

您不能使用document.write,因为SVG是XML,而不是标签汤。

You can't use document.write since SVG is XML, not tag soup.

如果你想要导入完整的XML节点,您必须手动执行或使用标准DOM importNode方法。

If you want to import a full XML node, you either have to do it by hand or use the standard DOM importNode method.

例如,如果从AJAX检索XML节点,首先使用responseXML将响应解析为XML,然后使用document.importNode方法导入它,以便您可以在SVG文档中使用它,并使用标准DOM方法(appendChild或insertBefore)插入。

For example, if you retrieve an XML node from AJAX, first use the responseXML to parse the response as XML, then import it with the document.importNode method so that you can use it whithin your SVG document and insert it with a standard DOM method (appendChild or insertBefore).

更多推荐

SVG 1.1 Javascript参考

本文发布于:2023-11-16 18:44:13,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1606849.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:SVG   Javascript

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!