Created
July 30, 2013 22:26
-
-
Save slavikdev/6117629 to your computer and use it in GitHub Desktop.
JavaScript example how to print HTML document in a separate window (specifically tested in Internet Explorer 10).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var print_window = window.open( '', 'Title', 'height=400,width=600' ); | |
print_window.document.write( '<html><body><h1>Hello!</h1></body></html>' ); | |
// NOTE: two statements below make it all work in IE 10. | |
print_window.document.close(); | |
print_window.focus(); | |
print_window.print(); | |
print_window.close(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment