Cool, thanks for sharing!
FYI, the OP posted an update with a reply to you:
> This article was posted on Hacker News... > In the comments there somebody mentioned an interesting use of the <script> tag in SVG. I’m unsure though whether I should be impressed or horrified :D