Page a.com
loads a javascript file from b.com
like this:
<script src="http://b.com/file.js"></script>
b.com/file.js
adds some content to a.com
.
The file.js
is like this:
document.write("<script ... <link rel=\"stylesheet\" ... <div> ... <form> ...");
But I know document.write
is not good. But what are the alternatives? I don't think it's "ok" to add complete html code inside document.write ... or not?