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
I'm new to javascript but i have an idea you can set id to just like
then you can append your script to header by using this code:
var h = document.getElementById('h');
var scripts = document.createElement('script');
switch(window.innerHeight){
case 800:
scripts.src = 'storybook.js';
scripts.type = 'text/javascript';
break;
}
h.appendChild(scripts);
You can change scripts source by add more case. Thanks for reading.