I need to be able to copy the current webpage into a new popup window for a print preview. There is a grid on the page with children, so if they expand one of the rows to s
Perhaps this does the trick (in IE and Firefox, not in Opera. Don't know about WebKit):
var yourDOCTYPE = ""+ document.documentElement.innerHTML+ "