3

Possible Duplicate:
How to detect if JavaScript is disabled?

Is it possible to detect whether javascript has been disabled if so redirect to another page? My application is being developed with JSPs, as I am using a lot of fancy javascript stuff in my application.
Thanks in Advance
Dean

Community
  • 1
  • 1
Dean
  • 8,668
  • 17
  • 57
  • 86
  • Found another answer to this question at http://stackoverflow.com/questions/121203/how-to-detect-if-javascript-is-disabled > "noscript" tag IS the most semanticly > accurate way to specify non-javascript > content - and rather then detecting if > javascript is disabled, detect if it's > enabled. So show the "you need > javascript to properly use my site" > message by default, but hide it with a > javascript function immediately > onLoad. – matt lohkamp – djangofan Jun 29 '10 at 16:16

2 Answers2

4

You can use the <noscript> tag: http://www.boutell.com/newfaq/creating/detectjs.html

Jim Lamb
  • 25,355
  • 6
  • 42
  • 48
0

Know this is an old thread, but just thought it add my own solution. I have javascript controlled <div> and on a browser where javascript is disabled, none of these are show so:

  1. Have a standard <div> in center of page saying “please enable javascript to view or click here for non javascript page

  2. Set the z-value to -1

  3. Have all javascript controlled <div> and set with a white/whatever background and a z-index value to 0 or higher

The javascript controlled <div> will cover the message if enabled, and show it if not.

Hope that this gives one or two of you a few ideas. Although this was specifically for my site, you may find that thinking out the box may help you too.

Prasad Jadhav
  • 5,090
  • 16
  • 62
  • 80
Mark
  • 1