1var newScript = document.createElement("script");
2newScript.src = "http://www.example.com/my-script.js";
3target.appendChild(newScript);
4
1var newScript = document.createElement("script");
2var inlineScript = document.createTextNode("alert('Hello World!');");
3newScript.appendChild(inlineScript);
4target.appendChild(newScript);
5