javascript include a js file from another code example
Example 1: javascript dynamicly include another js file
var script = document.createElement('script');
script.src = "https://www.examplesite/myscript.js";
document.head.appendChild(script);
Example 2: javascript include a js file from another
// jQuery
$.getScript('/path/to/imported/script.js', function()
{
// script is now loaded and executed.
// put your dependent JS here.
});