I have made a js function for including another Javascript in my html. I need to make sure that the script I have loaded using the function is has completed processing and then only move further in my original script.
function loadBackupScript(){
var script = document.createElement('script');
script.src = 'http://www.geoplugin.net/javascript.gp';
script.type = 'text/javascript';
var head = document.getElementsByTagName("head")[0];
head.appendChild(script);
}
I need to know that the script has loaded to use its functions ahead. How do I do that?