title: How to determine if document.write() will overwrite the page, i.e. if current script's been loaded asynchronously?
body: <p>If <code>document.write()</code> is called after the page is loaded, the whole page will get overwritten. This may happen e.g. when the call to <code>document.write()</code> is placed inside a script that's being loaded asynchronously. Would it be possible to find out within that script if this is indeed the case, without resigning <code>document.write()</code> completely?</p>