Search code examples
clojurehiccup

Render async script tag with hiccup


How would I render an async script tag in hiccup?

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

Solution

  • I think you should just code it as

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

    Reference: http://www.w3schools.com/tags/tag_script.asp