How can I use javascript to determine if an HTMLScriptElement has already been fully loaded?
How can I determine if a dynamically loaded script has finished loading
Why not add an id to the script element? Check to see if the id exists before continuing....
function includeJs(jsFilePath) {
if (document.getElementById(jsFilePath+"_script")) {
return;
}
var js = document.createElement("script");
js.type = "text/javascript";
js.id = jsFilePath+"_script";
js.src = jsFilePath;
document.body.appendChild(js);
}