24 lines
719 B
HTML
24 lines
719 B
HTML
<html>
|
|
<head>
|
|
<script src="https://cdn.jsdelivr.net/npm/scittle@0.7.27/dist/scittle.js" type="application/javascript"></script>
|
|
<script src="https://cdn.jsdelivr.net/npm/scittle@0.7.27/dist/scittle.cljs-ajax.js" type="application/javascript"></script>
|
|
<script type="application/x-scittle">
|
|
(require '[ajax.core :refer [GET]])
|
|
|
|
(defn handler [response]
|
|
(js/alert (str response)))
|
|
|
|
(defn make-request []
|
|
(GET "html/cljs-ajax.html" {:handler handler}))
|
|
|
|
;; export function to use from JavaScript:
|
|
(set! (.-make_request js/window) make-request)
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<button onclick="make_request()">
|
|
Click me!
|
|
</button>
|
|
</body>
|
|
</html>
|