If for instance you are submitting a form,then
build the html document in a
string then write it.
document.write(string);
document.close();
now when the string/html is rendered and the on load event from body will trigger the submit form
and you have a blank page with a single submit.
I am not running the code but just putting something down so you get the idea.This is the
form of the submit function