Have any advice. Why I can not add the javascript into a DOM?
var strScript = "<script type='text/javascript'></script>";
$("#someElement").append(strScript);
See this post. The top-rated comment does a stand-up job of going through what works and why.
You can always do
document.write('\x3Cscript src="your-jsfile.js" type="text/javascript" >\x3C/script>');
document.body.innerHMTL += str instead of document.write( str );document.close();
bodyinstead of#someElement).