Off the top of my head:
document.write
needs to be used in the page load or body load. So if you want to use the script in any other time to update your page content document.write is pretty much useless.
Technically document.write
will only update HTML pages not XHTML/XML. IE seems to be pretty forgiving of this fact but other browsers will not be.