Upgrade shadow

This commit is contained in:
Michiel Borkent 2021-05-26 12:18:48 +02:00
parent ca2bc107f0
commit 8906a59ab1
7 changed files with 189 additions and 7 deletions

View file

@ -0,0 +1,42 @@
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="css/style.css">
<script src="js/sci-script-tag.js" type="application/javascript"></script>
<script type="application/x-sci">
(defn my-alert []
(js/alert "You clicked!"))
(set! (.-my_alert js/window) my-alert)
</script>
</head>
<body>
<h1>SCI script tag</h1>
<pre>
<code class="html">
&lt;head&gt;
&lt;script src=&quot;https://borkdude.github.io/sci-script-tag/js/sci-script-tag.js&quot; type=&quot;application/javascript&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;application/x-sci&quot;&gt;
(defn my-alert []
(js/alert &quot;You clicked!&quot;))
;; export function to use from JavaScript:
(set! (.-my_alert js/window) my-alert)
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;button onclick=&quot;my_alert()&quot;&gt;
Click me!
&lt;/button&gt;
&lt;/body&gt;</code></pre>
<button onclick="my_alert()">
Click me!
</button>
</body>
</html>