4
Using the tag <noscript>
it is possible to detect when the Javascript engine is disabled in the browser (as per this question), but how to redirect the browser, after a few seconds, to a particular page or URL if you enter the <noscript>
?
In addition to redirecting after a certain time (e.g., 5 seconds), display a message before the start of the body
, something like:
<body>
<noscript>
Seu navegador não tem suporte ao JavaScript ou ele está desabilitado!
<br>
Você será redirecionado em 5 segundos...
</noscript>
... resto do conteúdo
</body>
Then I’d have to use two
<noscript>
, one in the body and one in the head?– Sam
@Sam not necessarily, because I tested Noscript with Meta right inside Body and it worked. (Chrome 74, Win 10). You have to see how the Noscript tag is interpreted in the Render Tree
– hugocsl
But I think putting meta tags inside the body is incorrect within HTML5 specifications, no?
– Sam
@Sam I will search, but some tags normally used inside the <head> tb are allowed inside the body, like <link> and <style>, the meta I will search, but it should be allowed, because it works :)
– hugocsl
Take a look here :D
– Sam
@Sam I edited the answer and put in a few more pointers. Note that even having tags like <p> inside the noscript in the head, the browser puts this content inside the body, and redirects it as expected
– hugocsl
I had remembered
meta http-equiv="refresh"
but had not thought to use so interesting the idea– Ricardo Pontual
@Ricardopunctual I just remembered pq the other day even used it in an rss response.
– hugocsl