←back to thread

An SVG is all you need

(jon.recoil.org)
258 points sadiq | 1 comments | | HN request time: 0s | source
Show context
morshu9001 ◴[] No.46237449[source]
An SVG and JS, right? It's not interactive on its own.
replies(1): >>46237621 #
avsm ◴[] No.46237621[source]
The JS is embedded within the SVG file and not exposed outside it
replies(2): >>46238207 #>>46240511 #
zamadatix ◴[] No.46240511[source]
The JS is exposed in the full page's context the same as if you included a <script> under a <div> instead of <svg>. In much the same way, whether the <script> is before or after the <svg> tag doesn't matter - it's just a script working on a single DOM (with different namespaces for certain elements) either way.
replies(1): >>46240672 #
1. morshu9001 ◴[] No.46240672{3}[source]
I guess the point is you can give a single .svg file with the js inside. But you can also give a single .html with svg and js inside.