I wonder how to add an attribute "async" to the header with backdrop_add_js ?
Here is the script linked to external js file I want to output in the header:
<script async src="external-js-path"></script>
Here's my code but I'm stuck here:
backdrop_add_js("external-js-path", array('type' => 'external', 'scope' => 'header'));
backdrop_add_js()
takes two parameters:$data
and$options
. One of the keys you can add to the$options
array isattributes
:See https://docs.backdropcms.org/api/backdrop/core%21includes%21common.inc/f... for full details.