使用打嗝渲染异步脚本标记

时间:2016-11-29 23:03:42

标签: clojure hiccup

如何在hiccup中呈现异步脚本标记?

<script src="demo_async.js" async></script>

1 个答案:

答案 0 :(得分:3)

我认为你应该把它编码为

(use 'hiccup.core)
(html
  [:script {:src "demo_async.js"  :async "async"} ] )

  =>  <script src="demo_async.js" async="async" ></script>

参考:http://www.w3schools.com/tags/tag_script.asp