diff options
| author | kx <kx@radix-linux.su> | 2026-10-17 16:39:23 +0300 |
|---|---|---|
| committer | kx <kx@radix-linux.su> | 2026-10-17 16:39:23 +0300 |
| commit | ec1891d58b9514b621725620453cec0e31e18389 (patch) | |
| tree | 6721f92c0afae3d933343b4a573ac8e5389827c6 /examples/script-file/README | |
| parent | 73d23259a690cd29c0ac74a4de963e23ecfebfac (diff) | |
| download | svgc-trunk.tar.xz | |
Diffstat (limited to 'examples/script-file/README')
| -rw-r--r-- | examples/script-file/README | 24 |
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. |
