$(document).ready(function() {window.print();});>

Why do side effects occur?