Skip to content

Instantly share code, notes, and snippets.

@GerHobbelt
Created May 6, 2012 15:59
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save GerHobbelt/2623079 to your computer and use it in GitHub Desktop.
Save GerHobbelt/2623079 to your computer and use it in GitHub Desktop.
svg -> foreign object -> iframe to load and render arbitrary html inside SVG (based on Matt Finkle article)
# Editor backup files
*.bak
*~
<!DOCTYPE html>
<html>
<body>
<p>SVG as per Finkle</p>
<p style="color: red;" > WARNING: NoScript barfs a hairball about it being click-jacking when you click on links inside the iframe</p>
<svg width="960" height="850">
<g transform="translate(300, 0) rotate(20)">
<foreignObject x="10" y="10" width="800" height="800">
<body xmlns="http://www.w3.org/1999/xhtml">
<iframe src="http://starkravingfinkle.org/blog" style="width:700px;height:700px"></iframe>
</body>
</foreignObject>
</g>
</svg>
<script type="text/javascript" src="http://gerhobbelt.github.com/bl.ocks.org-hack/fixit.js" ></script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment