I want to check if Javascript enabled or not. If its enabled then it show the rest of code but if it's disabled it will redirect to google.com
Now, how to do that? I'm trying to write this code:
<script type="text/javascript">
document.write("Hello World!")
</script>
<noscript>Your browser does not support JavaScript!
<p>JS must be enabled</p>
<META HTTP-EQUIV=Refresh CONTENT="3; URL='www.google.com'">
</noscript>
<p>this code must be hidden when JS is disabled</p>
but the result is:
Your browser does not support JavaScript!
JS must be enabled
this code must be hidden when JS is disabled
and what I want to is the code outside the noscript won't run if there's no JS enabled so, at the example it would like this:
Your browser does not support JavaScript!
JS must be enabled
(go to google)
Info: I'm using PHP