Any idea why the piece of code below does not add the script element to the DOM?
var code = \"\"; $(\"#someElement\").append(cod
Your script is executing , you just can't use document.write from it. Use an alert to test it and avoid using document.write. The statements of your js file with document.write will not be executed and the rest of the function will be executed.
document.write