img Inside a foreignObject Inside an svg Inside an img

后端 未结 2 1805
后悔当初
后悔当初 2020-12-19 19:27

Here is my test case.

http://tobeythorn.com/isi/dummy2.svg

http://tobeythorn.com/isi/isitest.html

  • If I just open the svg by itself, the inne

2条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-19 20:20

    I can't see your example, but if you using JS to append a html element to svg, you must remember using prefix to tell browser that this element is svg or html.

    For example, if you append a html img element:

    $('svg').append('svg:foreignObject').append('xhtml:img').attr('src','./foo.jpg');
    

提交回复
热议问题