Any reason why the following code isn't working?
alert("1");
document.head.appendChild("<script type=\"text/javascript\" src=\"https://getfirebug.com/firebug-lite.js\"></script>");
alert("2");
(I know it is breaking because the 1 is alerted but not the 2.)
What is the proper way to accomplish the same thing? Namely, to append a script tag to the document head, where the tag gets a .js file using the SRC attribute. I don't want it to write javascript inline.
Thanks!