Require Javascript to be Enabled

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
Terriator
Forum Commoner
Posts: 60
Joined: Mon Jul 04, 2005 12:46 pm

Require Javascript to be Enabled

Post by Terriator »

I've searched on this topic for a while now, but I thought it would be best to ask.

What is the best, easiest and/or most secure way to require that the user has javascript enabled.

That is, make the browser show some warning message if it's not enabled, without printing anything else than the warning.
nshiell
Forum Newbie
Posts: 12
Joined: Mon Oct 19, 2009 12:20 pm

Re: Require Javascript to be Enabled

Post by nshiell »

Firstly why can't it show the information without JS? BAD REGRESSION?


Well you could use CSS to hide the content and use JS to turn the display of the content back on, is this ok?
OR you could display a blank page and use JS/AJAX to pull in and display the content after the page has loaded (not recommended).
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: Require Javascript to be Enabled

Post by califdon »

Terriator wrote:I've searched on this topic for a while now, but I thought it would be best to ask.

What is the best, easiest and/or most secure way to require that the user has javascript enabled.

That is, make the browser show some warning message if it's not enabled, without printing anything else than the warning.

Code: Select all

<noscript>
   <h3>Your browser appears to have scripts disabled. Some features of this page will not be usable unless you enable scripting in your browser.</h3>
</noscript>
Post Reply