1
Guys I’m giving a window.print();
to print my page, soon after it I send the window.location
to redirect the page, the problem and the page and redirect before the print command. I need to make the redirect work only when the user prints or cancels the print.
Can someone help me? Follows my code:
$(document).ready(function () {
// Remove o loading
$(".se-pre-con").hide();
// Remove Menu topo
$(".header").hide();
$('.content').css({
top: ("0px")
}).show();
// Imprime a página
window.print();
// Redireciona página
window.location = 'Logado.php?pagina=<?= $pagina_crypt ?>';
});
increased to
}, 1000);
and it worked. Thank you– Hugo Borges
However I noticed that it takes 1000ms to redirect, after closing the window. It is possible to redirect as soon as the user closes the window?
– Hugo Borges
@Hugoborges, Unfortunately I only achieved this by adjusting the time, a little for more or a little for less until checking the best configuration with this implementation.
– Allan Andrade