I have the follwing JavaScript.
document.write(content) writes content on the document stream.
You have to close the stream after writing on the document in order to continue the page loading
document.write("hello");
document.close();