Similar to that of my recent post Added W3C Validated Logos to Some Pages—to get my SVG code validated by W3C.
I submited my SVG file to the W3C’s validator, which showed me one error. To illustrate this, I used an sample SVG in the official web site of SVGPan as an example.
Googling for something likes “svg script type” helps. As can be seen,
> is underlined, so I guessed that this kind of
self-closing tags wouldn’t the test. Just like HTML, change this to
<script ...></script>. From what I’d seen online, I set the
text/ecmascript, and luckily this works.
For valid SVG files which embed SVGPan, the following items are necessary:
- A type declaration at the very beginning
<script>tag with appropriate