[Last Call] Learn how to a build a cloud-first strategyRegister Now


How do I stop page processing if Javascript in disabled?

Posted on 2010-01-02
Medium Priority
Last Modified: 2013-12-20

I am developing with Coldfusion and most of my site is Javascript dependent.  Rather than writing hundreds of lines of <noscript> code variance, I want to simply stop page processing when the user has Javascript disabled, and display a message that says "You must have Javascript enabled to view this site."

I have tried several ways to do this, but no luck.

Does anyone know how to do this?
Question by:chaseivey
LVL 22

Accepted Solution

kadaba earned 600 total points
ID: 26162517
LVL 63

Assisted Solution

Zvonko earned 400 total points
ID: 26162520
The problem is that cftags are executed before any <script> tag or <noscript> tags are evaluated.
Terefore you need to check once that client browser has script enabled and use that check result in a session variable and do not checks from there on.
For that you can define one session veraible and check for existance of that variable in the Application.cfm (or .cfc) and if it is not existant then do a postback for defining that variable trough JavaScript.

Do you need an example or can you check that on your own?


Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question