51 lines
1.6 KiB
HTML
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>
|
|
<head>
|
|
<script src="https://borkdude.github.io/sci-script-tag/js/sci_script_tag.js" type="application/javascript"></script>
|
|
<script type="application/x-sci">
|
|
(defn my-alert []
|
|
(js/alert "alert!"))
|
|
</script>
|
|
</head>
|
|
|
|
<body>
|
|
<button onclick="user.myAlert()">
|
|
Click me
|
|
</button>
|
|
</body>
|
|
</pre>
|
|
|
|
<button onclick="user.myAlert()">
|
|
Click me
|
|
</button>
|
|
</body>
|
|
</html>
|