I especially don't understand this part:
When you use document.write outside of a script tag embedded inline in the page [...]
setTimeout(function() { document.write('foo'); document.close(); }, 1);
I especially don't understand this part:
What is "outside of a script tag embedded inline in the page" supposed to mean?