summaryrefslogtreecommitdiff
path: root/examples/script-file/README
diff options
context:
space:
mode:
Diffstat (limited to 'examples/script-file/README')
-rw-r--r--examples/script-file/README24
1 files changed, 24 insertions, 0 deletions
diff --git a/examples/script-file/README b/examples/script-file/README
new file mode 100644
index 0000000..8f10bdf
--- /dev/null
+++ b/examples/script-file/README
@@ -0,0 +1,24 @@
+SVGC interactive-script example
+===============================
+
+This example demonstrates __svg_sheet_add_script_file().
+
+The user writes only change-color.js as plain UTF-8 JavaScript source.
+The C application registers that file with the SVG sheet; SVGC reads and
+copies it into a <script type="text/javascript"><![CDATA[...]]></script>
+definition when serializing the SVG.
+
+After installing SVGC:
+
+ make
+
+Open example.svg directly as an SVG document, or use view.html, which
+embeds it with <object type="image/svg+xml">. Click the red circle: the
+script changes its fill to blue. Loading the SVG with <img> deliberately
+does not execute scripts in modern browsers. Opening local files may also
+be affected by browser security settings; a local HTTP server is an
+alternative for manual testing when the browser restricts file://.
+
+No binary scripts or external dependencies are bundled with the SVG.
+No JavaScript parser is part of the SVGC library; the viewer executes
+any embedded source in its normal security context.