$(w.document).html(w.opener.runonload());
You cannot set innerHTML-or, therefore jQuery html()is for the Document object itself.
, , html(), ( <div>) . doctype /, <html>/<body>/etc a <div> , , Document, WRONG_DOCUMENT_ERR DOMException. ( , .)
, - :
w= window.open('', '_blank');
w.document.write($('#newcode').val());
w.document.close();
innerHTML document.documentElement, , <!DOCTYPE>, , Quirks.