if (img.outerHTML) { x_win.document.write(img.outerHTML); x_win.document.close(); } else { x_win.document.body.appendChild(img); }