-
-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathbase.html
42 lines (34 loc) · 991 Bytes
/
base.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="css/style.css">
<script src="js/scittle.js" type="application/javascript"></script>
<script type="application/x-scittle">
(defn my-alert []
(js/alert "You clicked!"))
(set! (.-my_alert js/window) my-alert)
</script>
</head>
<body>
<h1>Scittle</h1>
<pre>
<code class="html">
<head>
<script src="https://babashka.github.io/scittle/js/scittle.js" type="application/javascript"></script>
<script type="application/x-scittle">
(defn my-alert []
(js/alert "You clicked!"))
;; export function to use from JavaScript:
(set! (.-my_alert js/window) my-alert)
</script>
</head>
<body>
<button onclick="my_alert()">
Click me!
</button>
</body></code></pre>
<button onclick="my_alert()">
Click me!
</button>
</body>
</html>