I have this function which is imported directly in the HTML
function include(filename){
var head = document.getElementsByTagName('head')[0];
script = document.createElement('script');
script.src = filename;
script.type = 'text/Javascript';
head.appendChild(script);
}
And I want to use it to import my other JSs programatically like this
function testRunner(){
include('Point.js');
include('Grid.js');
gridTest();
}
the JSs are showing in the HTML in the head and they look ok...
But the other JSs cannot see it.
Why ?