Originally Posted by Old Pedant
But that can't apply in this case, Felgall: He wants to do a document.write after a setTimeout.
The document.write defined by postscribe that replaces the native call can only run AFTER the page has loaded as it uses an id to determine where in the page that the document.write is to write to. When you use postscribe you cannot use document.write before the part of the page that the postscribe call references has loaded.
Postscribe effectively converts all the document.write calls in the page into the equivalent innerHTML calls.
For example the Google adsense script uses document.write statements to insert the ad but if you use postscribe you can add the script at the bottom of the page after the page has loaded and have those document.write statements work. The document.write statements inside of the Google show_ads.js script will function correctly to insert the ad into the page when you code the call like this:
google_ad_client = "pub-9999999999999999";
google_ad_slot = "9999999999";
google_ad_width = 300;
google_ad_height = 250;
Of course you would only use this approach when the document.write statements are inside of a third party script that you are not allowed to directly recode to use 21st century replacements. It is far better that you rewrite the document.write calls to better code yourself where possible rather than using postscribe to override the write function defined by the browser.postscribe.js
Having document.write statements that use the Postscribe write function in place of the built in one should be able to work just as well after a setTimeout as using innerHTML or DOM calls would.