So i have the following code in index.html, and i got it from google's developer site, but now i need to run the function mapsResume()
after the google maps api library finishes downloading.
function downloadJSAtOnload() {
var element = document.createElement("script");
element.src = "http://maps.googleapis.com/maps/api/js?libraries=places";
document.body.appendChild(element);
mapsResume();
}
mapsResume(){
/* lots of code */
}
if (window.addEventListener)
window.addEventListener("load", downloadJSAtOnload, false);
else if (window.attachEvent)
window.attachEvent("onload", downloadJSAtOnload);
else window.onload = downloadJSAtOnload;