javascript - loading scripts and making sure they are present -


i have onload function loading d3...

var d3script = document.createelement("script"); d3script.src = "http://d3js.org/d3.v3.min.js"; head.insertbefore(d3script, head.firstchild);  d3script.onload = function() {  }; 

while group of async's running google maps api calls. want make when other async's finish , return array, can start doing d3 stuff. don't know how make if: a. d3 finishes loading first, checks other array has returned before running b. array of async's returns first, checks d3 , if it's not there waits load before doing d3 operations.

var d3script = document.createelement("script"); d3script.src = "http://d3js.org/d3.v3.min.js";  otherstuff.onload = function() {      head.insertbefore(d3script, head.firstchild);       d3script.onload = function() {           // stuff      }; }; 

Comments

Popular posts from this blog

java - Intellij Synchronizing output directories .. -

git - Initial Commit: "fatal: could not create leading directories of ..." -