scittle/resources/public/disable_auto_eval.html
Michiel Borkent 62b3f1ad5f auto-eval
2021-05-27 09:55:08 +02:00

27 lines
892 B
HTML

<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="css/style.css">
<script src="js/scittle.js" type="application/javascript"></script>
<script>scittle.core.disable_auto_eval()</script>
<!-- to do the same as scittle does by default: -->
<!-- <script>scittle.core.eval_string("(.addEventListener js/document \"DOMContentLoaded\" js/scittle.core.eval_script_tags false)")</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>
<p>On this page, auto-eval is disabled.</p>
<p><button onclick="scittle.core.eval_script_tags()">
Click me to evaluate script tags!
</button></p>
<p><button onclick="my_alert()">
Click me to run evaluated function!
</button></p>
</body>
</html>