Skip to content

Instantly share code, notes, and snippets.

@emilstahl
Created April 18, 2014 22:33
Show Gist options
  • Save emilstahl/11067173 to your computer and use it in GitHub Desktop.
Save emilstahl/11067173 to your computer and use it in GitHub Desktop.
Trigger browser to print page
<html>
<head>
<meta http-equiv=Content-Type content="text/html; charset=UTF-8">
<script type="text/javascript">
function Print(){
document.body.offsetHeight;window.print();
}
</script>
</head>
<body onload="Print()">
Du er en gris.
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment