Is it possible to include jQuery SVG source code in a standalone SVG document? I mean like:
<script type="application/javascript">
<![CDATA[
// jQuery SVG code
]]>
</script>
I need the SVG document to be independent of other files. (copy it elsewhere and it will work without any other files, internet connection,…)
Trying so, I get:
error on line 383 at column 16623: StartTag: invalid element name
Which is:
b='<'+a.nodeName;
How to make it seem as a string, not a start tag?
I’m unable to make it work by commenting out CDATA parts or the script as whole (I have tried //, /* */ and <!-- -->). I guess I’m missing something simple here…
Here is an example SVG document with a simple JS script with jQuery 1.6.4 and jQuery SVG 1.4.4 source codes: http://dl.dropbox.com/u/5552845/test.svg
Note: moving jQuery SVG source code out will lead to perfectly working SVG document
jQuery SVG includes the string ‘]]>’, which ends the cdata block.
If you change ‘]]>’ to ‘]’+’]>’ the file becomes valid.
see http://dl.dropbox.com/u/3885046/test.svg