How to add a custom attribute to the script tag via drupal_add_js?
It's old but I have the same problem (adding "crossorigin" attribute) and this is my answer :


There is an issue about it here : https://www.drupal.org/project/drupal/issues/1664602
@kenorb solution can't work because "drupal_add_js" add "script" tag automatically.
But... you can try this workaround (a little dirty) :
close the script tag and open yours without closing


.

drupal_add_js('//--&gt;&lt;!]]&gt;&lt;/script&gt;&lt;script src="//static.queue-it.net/script/queueconfigloader.min.js" data-queueit-c="MyClientID"&gt;&lt;!--//--&gt;&lt;![CDATA[//&gt;&lt;!--', 'inline');