Programming Tips - How do I open a new plain text page?

Date: 2009jun15 Language: javaScript Q. How do I open a new plain text page? A.
function newTextWindow() { var win = window.open(); win.document.open('text/plain'); win.document.write('hello'); win.document.close(); }