Skip to content

Script Tag Deferred ​

Last updated View as Markdown

Generates an HTML <script> tag with the defer attribute for a given resource URL. The tag has a type attribute of text/javascript.

Example ​

liquid
{{ 'index.js' | asset_url | script_tag_deferred }}

Output

html
<script src="https://cdn.youcan.shop/s/files/1/0561/7470/6753/t/1/assets/index.js?v=173664653397615025201664456763" type="text/javascript" defer></script>