scittle/index.html
Michiel Borkent 471ab03ced update build
2021-05-23 12:20:14 +02:00

51 lines
1.6 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<script src="js/sci_script_tag.js" type="application/javascript"></script>
<script type="application/x-sci">
(defn my-alert []
(js/alert "alert!"))
</script>
</head>
<body>
<h1>SCI script tag</h1>
<h2>What is this</h2>
<p>This project exposes the <a href="https://github.com/borkdude/sci">Small Clojure Interpreter</a> in the
browser in such a way that you can use it with the <tt>script</tt> tag.</p>
<h2>Project status</h2>
<p>
This project is currently experimental and breaking changes are
bound to happen. Feedback is welcome on <a href="https://github.com/borkdude/sci-script-tag">Github</a>.</p>
<p>
You can get a copy
of <tt>sci_script_tag.js</tt> <a href="https://borkdude.github.io/sci-script-tag/js/sci_script_tag.js">here</a>. If
you want a pinned version of <tt>sci_script_tag.js</tt>, your best bet is to
download your own copy and host it yourself.
</p>
<h2>Example usage</h2>
<pre>
&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;alert!&quot;))
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;button onclick=&quot;user.myAlert()&quot;&gt;
Click me
&lt;/button&gt;
&lt;/body&gt;
</pre>
<button onclick="user.myAlert()">
Click me
</button>
</body>
</html>