V
V
Vladimir2017-12-08 19:17:45
JavaScript
Vladimir, 2017-12-08 19:17:45

How to print another page on one page when pressing the print button?

Good day! Can you tell me if you can print another page while being on one page? Thanks in advance for the replies!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Taratin, 2017-12-08
@Taraflex

In order to avoid problems with various browser security settings, it is better to add a hash in the #print style to the url, check its presence on the page itself and call window.print();

if(location.hash == 'print'){
window.print();
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question