scittle/base.html
Michiel Borkent 0e789d29df update build
2021-05-26 12:46:27 +02:00

43 lines
983 B
HTML

<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="css/style.css">
<script src="js/scittle.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>Scittle</h1>
<pre>
<code class="html">
&lt;head&gt;
&lt;script src=&quot;https://borkdude.github.io/scittle/js/scittle.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>