I have 3 JavaScript files that I would like to load from an index.html file. I\'m choosing among them by using if statements which I only know how to d
index.html
if
By appending the script to the document.
if(window.innerHeight == 800){ var script = document.createElement("script"); script.src = "storybook.js"; document.getElementsByTagName("head")[0].appendChild(script); }