var script = document.createElement('script') script.type = 'text/javascript' script.src = 'http://d3js.org/d3.v3.min.js' document.head.appendChild(script)