javascriptbrowser

How do I know if Javascript has been turned off inside browser?


I assume that you can't use a JavaScript code snippet to validate if the browser user has turned off JavaScript. So what can I use instead? Can someone offer a code sample?

I'm looking to wrap an if/then statement around it.

I often code in CFML, if that helps.


Solution

  • Are we talking about something like this:

    JavaScript:

    <body>
    ...
    ...
    <script type="text/javascript">
    <!--
    document.write("Hello World!")
    //-->
    </script>
    <noscript>Your browser does not support JavaScript!</noscript>
    ...
    ...
    </body>