I do not understand how the built-in script gets the variables from the window, that is, I wanted to do this:
<script src="script.js">var A = 123;</script>
meanwhile, script.js gets the variable A:
alert(A);
But that doesn't work. An interesting option is not to write the full script inside the script tag, but only to transfer the necessary variables with which the script can work.