How to use async attribute in script tag in haml?

Viewed 2532

How to add attributes like async or defer in script tag in Haml? I tried to put it on a same line as href, but it does not work.

 %a.twitter-share-button{href: "https://twitter.com/share?ref_src=twsrc%5Etfw", data: { url: "http://example.net", show: { count: "false" } } } Tweet
2 Answers

Should be:

%script{async: 'async', src: 'hogehoge.com/test.js', type: 'application/javascript'}
Related