server-side javascript enabled detection

Is there a server-side way to detect if the client browser has javascript enabled??

I found an external component that does it, but it's not free...

I would like to detect JS status without external DLLs or components, just pure ASP: is this possible?

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

courtesy of AspGuru

<meta http-equiv="refresh" content="1; URL=thepage.asp?script=no">
<script language="Javascript">

thepage.asp will have a querystring "script". yes means javascript enabled else not enabled.

KupiAuthor Commented:
I need the detection to happen before the <html> tag...
With help of cookies, you can do so


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Exploring SharePoint 2016

Explore SharePoint 2016, the web-based, collaborative platform that integrates with Microsoft Office to provide intranets, secure document management, and collaboration so you can develop your online and offline capabilities.

KupiAuthor Commented:
What if I can't create hidden fields or execute onload functions because the <html> tag has not yet be generated?

Set browserdetect = Server.CreateObject("MSWC.BrowserType")
Response.Write("JavaScript: " & browserdetect.JavaScript)
sorry, scratch that... this will only tell you if the browser is JavaScript compatible, not if the user has it disabled.
How about using this?

<% Response.Write("You must have JavaScript enabled to use this form.") %>

 If you need to set a flag, swap out the "Response.Write" with something like this
<% session("bJavaScript") = FALSE %>

- or(redirect them to a non-javascript portion of the site) -

<% response.redirect=("no-javascript.asp") %>
KupiAuthor Commented:
In this way I can prevent users to log in if js is disabled... but what happens if they disable js status after logging in, while they're inside the application?

I should put a js check before every single piece of code...
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

I will leave the following recommendation for this question in the Cleanup topic area:
    Accept: hongjun {http:#9850320} & c_swanky {http:#9851981}

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

EE Cleanup Volunteer
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.