开发者

Get DOM of SVG residing in iframe

I have an iframe that has an SVG embedded in it. The SVG is generated by GraphViz so I can't change much in it. What I need is access to the SVG DOM in the parent page.

The source of the iframe is

<iframe id='graph' src='gen-graph.php' /> 

Any hints on how I can get access to the different nodes (text, polygon) etc of the 开发者_开发知识库SVG?


Here's an example that reaches into an external svg document from the parent document.

What you're looking for is the iframe's contentDocument, which can be accessed via yourIFrameElement.contentDocument. Then use contentDocument as you'd use the normal document object.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜