Modify this js code so that it runs every couple of minutes

0

I have this code, which means that when you click on any part of the page, a window opens with another page, for example advertising, but always, I want you to do it when you enter, and for example after 2 minutes that is on the page without clicking.

	<script>
function PopUP(){
window.open('https://publicidad.com','_blank'); //abrir nueva ventana
document.focus(); //poner el foco en la ventana actual
}
</script>
    
asked by MatiST00 30.06.2018 в 21:28
source

1 answer

0

You can do it with setInterval with time in milliseconds, for example:

<body onload="setInterval(PopUp(),120000)">
    
answered by 30.06.2018 в 22:47