1

A client web browser has JavaScript enabled, but I want to emulate the state where JavaScript is disabled to run code within noscript tags. For example: on the site is a button - "No JavaScript". When the client clicks the button, the code within nonscript tags will execute. Is it possible?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Delicja
  • 193
  • 1
  • 8
  • 18

1 Answers1

1

You can not control whether the user has JavaScript enabled in their browser or not, so although you could potentially throw a JavaScript error to maybe stop execution (see: Is it possible to stop JavaScript execution?) you won't be able to disable it and cause the noscript tag content to display without disabling JavaScript in your browser.

Community
  • 1
  • 1
shannonman
  • 841
  • 4
  • 8