Skip to main content
Known Participant
March 18, 2009
Question

Javascript Disabled in CF?

  • March 18, 2009
  • 3 replies
  • 500 views
How and where in CF can you test to see if a Web Browser has JavaScript disabled (or does it take JS to do that)?

Can it be detected server side?

Thanks,
hefterr
    This topic has been closed for replies.

    3 replies

    davidsimms
    Inspiring
    March 18, 2009
    Google "detecting javascript enabled."
    Inspiring
    March 18, 2009
    The easiest JavaScript solution is to use the following code to display a message on the first (login?) page or the page that needs JavaScript.

    March 18, 2009
    You can't STRICTLY do this with CF alone as CF is a server-side application.

    I would recommend setting a cookie with JavaScript into a users session, THEN use CF to try and read the cookie from the users session. If the cookie doesn't exist, it clearly means that JavaScript wasn't able to set a cookie, possibly meaning JS is disabled.

    So, with this, you can do some conditional logic using CFIF and the like.

    Good luck.

    Mikey.