I thought this type of questions we can ask to javaScript but when javaSCript is not enable how can we know if javaSCript is enabled or disabled. Well browser answers about this question by html tag <noscript>. This is very easy then expected :).
If someone have turned off javaScript in his/her browser and we are saying them welcome by reading their cookie via javaScript but when we get know javaSCript is not on then that welcome message will not appear properly because javaScript is off and cookie cannot be read. Then we can load an image there. using <noscritp> block of code. This is the way how we can know if javaScript is enabled or JavaScript is disabled.
If our javaScript welcome message gets printed that means javaScript is enabled.
If our noscript message image get printed that means javaSCript is disabled.
[code lang=”js”]
<script type="text/javaScript">
window.write("javaScript is ON! Welcome Ateeq :)");
</script>
Following code is for when javaScript is off if javaScript is on Above code will work else following code.
<noscript>
<p>We are sorry JS is disabled in your bwoser so we could not Welcome you :(</p>
</noscript>
[/code]