Is there some innerHTML replacement in SVG/XML?

前端 未结 8 1640
一整个雨季
一整个雨季 2020-11-28 10:28

In HTML I can build a simple templating system by providing a template in form of a string, replace some parts of it and then assign it using innerHTML to some

8条回答
  •  旧时难觅i
    2020-11-28 10:37

    Check out the innerSVG javascript shim, it provides the functionality you want.

    2014 update: The DOM parsing spec defines innerHTML and outerHTML on Element, which makes these available on svg and xml elements. This has been shipping in Blink for a while now, first versions to support this was Chrome 32 / Opera 19, more details can be found in this bugreport.

提交回复
热议问题