0
I have no experience with programming, I would like a help: I found this code on the internet:
<html>
<head>
<script type="text/javascript">
var contador = 20;
function contar() {
document.getElementById('contador').innerHTML = contador;
contador--;
}
function redirecionar() {
contar();
if (contador == 0) {
document.location.href = 'https://google.com';
}
}
setInterval(redirecionar, 1000);
</script>
</head>
<body>
<p>Link vai expirar em... <label id="contador"></label></p>
</body>
</html>
but this code does the function of redirecting to the informed link after a given time in the counter.
I would like a code that opens the informed link in a new tab, keeping the current tab open, after a certain time in the counter. Thanks in advance
Please edit the question to limit it to a specific problem with sufficient detail to identify an appropriate answer.
–
Opening a new tab or window without user action goes against the security guidelines of browsers and they block this scheme.
– Sam