I am creating a website where the use of javascript is a priority, so I would like to know how to detect if the browser is running javascript when visiting my site, and if not, address it or give it the option to activate it immediately.
I am creating a website where the use of javascript is a priority, so I would like to know how to detect if the browser is running javascript when visiting my site, and if not, address it or give it the option to activate it immediately.
You can use the <noscript>
tag, to redirect it to a page that informs you that Javascript is disabled.
<noscript>
<META HTTP-EQUIV="Refresh" CONTENT="0;URL=redireccionarPagina.html">
</noscript>
use the <noscript>
tag
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Detectando si javascript está habilitado</title>
</head>
<body>
<script type="text/javascript">
alert("tiene js activado");
</script>
<noscript>
<h1>Comprobando si javascript está habilitado</h1>
<div class="deshabilitado">
<img src="images/error.png" alt="Javascript deshabilitado" />
Javascript está deshabilitado en su navegador web.<br />
Por favor, para ver correctamente este sitio,<br />
<b><i>habilite javascript</i></b>.<br />
<br />
Para ver las instrucciones para habilitar javascript<br />
en su navegador, haga click
<a href="http://www.enable-javascript.com/es/"
target="_blank">aquí</a>.
</div>
</noscript>
</body>
</html>