Skip to content

Instantly share code, notes, and snippets.

@fazlurr
Last active July 8, 2019 01:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fazlurr/158f7d44c674c71971634ee7126dd78d to your computer and use it in GitHub Desktop.
Save fazlurr/158f7d44c674c71971634ee7126dd78d to your computer and use it in GitHub Desktop.
function printcontent() {
var disp_setting="toolbar=yes,location=no,directories=yes,menubar=yes,";
disp_setting+="scrollbars=yes,width=300, height=350, left=50, top=25";
var content_vlue = document.getElementById("content").innerHTML;
var w = window.open("","", disp_setting);
w.document.write(content_vlue); //only part of the page to print, using jquery
w.document.close(); //this seems to be the thing doing the trick
w.focus();
w.print();
w.close();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment