The body of the script tag is srcnever executed. However, a loaded script can access its contents as the contents of any other element. Thus, this is a good place to store metadata associated with a loaded script.
In fact, it was a pleasant place for him before the attributes were introduced data-. Using them would be more appropriate, but the api related is probably older than the data-attributes, or they just wanted to keep it simple.
- .js:
var scripts = document.getElementsByTagName('script');
var thisScriptTag = scripts[scripts.length - 1];
textContent innerText , .