Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Teddy-Zhu/151afa59633b440bd6ea22d00af2a4e2 to your computer and use it in GitHub Desktop.
Save Teddy-Zhu/151afa59633b440bd6ea22d00af2a4e2 to your computer and use it in GitHub Desktop.
if (!document.getElementById('printFrame').contentWindow.document.execCommand('print', false, null)) {
document.getElementById('printFrame').contentWindow.focus();
document.getElementById('printFrame').contentWindow.print();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment