Search code examples
javascriptnoscriptscript-tag

noscript tag in a script tag?


Is it possible to put a noscript tag in a script tag ? Because I would like to perform a function that will check if JS is enable and if not it will redirect to an other link like this :

<script>
window.setInterval(function(){

   <noscript>
   <meta http-equiv="refresh" content="0; url=http://192.168.1.1/index.html" />
   </noscript>

}, 5000);
</script>

Thanks


Solution

  • No.

    Aside from being unable to put markup inside a script in the first place, it wouldn't make any sense.

    The script can't partially execute then discover that JavaScript is turned off entirely.