I want to call a common JS script file from the HTML code, like:
<script type=”text/javascript” src=”Common.js”></script>
In the JS script I can set a constant or variable for one condition.
Not a problem.
I can also create a variation of the Common.js file (like ‘CommonMod.js’) with the second condition.
Not a problem.
What I would like to do is have the script logic so that I could call the same Common.js script
from 2 different HTML files for one condition or the other.
Sort of like a ‘conditional pseudo-compiler’ that would use the condition selected in the HTML file
without reverting to 2 separate JS files with the condition initialize differently in each JS script file.
Question: Is there some sort of code/script I can use to do this? ?