Setting script src dynamically
However, the somecode.js is different based on other parameters on your page. So you would need to pass a variable rather than the static string to the src. If you just replace somecode.js, with a variable name, you code will not be called.
The following example shows how you can manipulate DOM to define src so that your code runs.