0

I am trying to find a solution to detect if clients brower has javascript enabled or not. Is there a way to check whether JavaScript is enabled in the client browser, in django if possible or in python?

1

2 Answers 2

0

Unfortunately, you can't do this unless trying a second request. There's no way to know this before actually interacting with the browser itself.

The closest I can think of is trying to set a cookie and store this information for future visits.

Hope it helps.

Sign up to request clarification or add additional context in comments.

Comments

0

The right approach is to degrade gracefully, but that is not always possible especially with web app. Use a <noscript> tag to tell the user to re-enable javascript.

If you need a solution through django, set a cookie using JS and try to read it in the second request. If you dont see the cookie then JS is not enabled. However, as a first request it can't be detected.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.