javascript - How to do a document.write to load a script without overwriting the whole page -


this question has answer here:

i executing code in browser (chrome) through url bar.

document.write('<script src=http://example.com/example.js></script>') 

when executed on page, overwrites , places:<script src=http://example.com/example.js></script> source code of page , launches .js script. question is, possible launch .js script without overwriting entire page small amount of code? if how?

try creating script element in javascript during body's onload handler, , append script element created document.


Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -