Creating SVG graphics using a server side script (

2019-04-30 10:57发布

Is there a way to generate an HTML file using a PHP script which has an SVG embedded where the SVG itself is dynamically generated by the PHP script?

Basically, I want to display a dynamically generated SVG image to a client but <embed>, <object> as well as <iframe> only refer to external sources while PHP generates the current HTML page only (and not the external sources)

Further, is there a Javascript solution possible where I add SVG elements in the current DOM one by one?

2条回答
Fickle 薄情
2楼-- · 2019-04-30 11:20

Try linking to your php file like this: <object href=svg_generator.php> <!-- other attributes necessary for embedding svg not listed here -->

查看更多
狗以群分
3楼-- · 2019-04-30 11:24

You can have a look at raphael http://raphaeljs.com/ a wonderful javascript library which make easy to manipulate svg objects in a cross-browser way.

I am sure that it will help you a lot

查看更多
登录 后发表回答