Skip to content

Instantly share code, notes, and snippets.

@adamtester
Created May 10, 2013 08:58
Show Gist options
  • Save adamtester/5553303 to your computer and use it in GitHub Desktop.
Save adamtester/5553303 to your computer and use it in GitHub Desktop.
Allows printing of another page without reloading or using ajax, should work in all browsers and as the frame is loaded after the W3 validator won't moan.
<div class="print_retroplan_div" id="print_retroplan_div" style="display:none;"></div>
function print_retroplan() {
$('#print_retroplan_div').append('<iframe name="print_frame" src="' + base_url + 'retroplan/print_page?ccode=' + ccode + '"></iframe>');
window.frames["print_frame"].window.focus();
window.frames["print_frame"].window.print();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment