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

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -