javascript - How to do a document.write to load a script without overwriting the whole page -
this question has answer here:
- what alternatives document.write? 10 answers
- load scripts after page has loaded? 8 answers
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
Post a Comment