Javascript link to a page and print (physically)

0

Good morning. I'm starting in javascript, but I urgently need to learn a task, which in my view seems relatively easy, but I can not seem to get it. Next:

You have the site example.com.br/2.html

I need to create a javascript that takes the user (in case I) from page 3.html to 100.html and every page that you load, print it automatically.

So far I've been able to get to the code:

window.location.href = "exemplo.com.br/2.html";window.print()

But when I put this code to run, it prints the page I'm currently in and after that I'm directed to the code page, not the other way, like I wanted it to be. But other than that, how do I have the browser go to the next page after I print?

    
asked by anonymous 05.03.2018 / 13:49

0 answers