Delicja
Delicja

Reputation: 183

Is it possible to enable/disable JavaScript in web browser using PHP?

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?

Upvotes: 1

Views: 911

Answers (1)

shannonman
shannonman

Reputation: 861

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.

Upvotes: 1

Related Questions