Solved

server-side javascript enabled detection

Posted on 2003-12-01
10
787 Views
Last Modified: 2012-08-14
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?

Thanks!
0
Comment
Question by:Kupi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
  • +1
10 Comments
 
LVL 33

Expert Comment

by:hongjun
ID: 9850235
courtesy of AspGuru

detection.html
=========
<html>
<head>
<meta http-equiv="refresh" content="1; URL=thepage.asp?script=no">
<script language="Javascript">
 window.location.href='thepage.asp?script=yes';
</script>
</head>
<body></body>
</html>


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


hongjun
0
 
LVL 3

Author Comment

by:Kupi
ID: 9850288
I need the detection to happen before the <html> tag...
0
 
LVL 33

Accepted Solution

by:
hongjun earned 50 total points
ID: 9850320
With help of cookies, you can do so
http://www.4guysfromrolla.com/webtech/082400-1.shtml

hongjun
0
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
LVL 3

Author Comment

by:Kupi
ID: 9850397
What if I can't create hidden fields or execute onload functions because the <html> tag has not yet be generated?
0
 
LVL 4

Assisted Solution

by:c_swanky
c_swanky earned 50 total points
ID: 9851981


<%
Set browserdetect = Server.CreateObject("MSWC.BrowserType")
Response.Write("JavaScript: " & browserdetect.JavaScript)
%>
0
 
LVL 4

Expert Comment

by:c_swanky
ID: 9852040
sorry, scratch that... this will only tell you if the browser is JavaScript compatible, not if the user has it disabled.
0
 
LVL 4

Expert Comment

by:c_swanky
ID: 9852077
How about using this?

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


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

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

<noscript>
<% response.redirect=("no-javascript.asp") %>
</noscript>
0
 
LVL 3

Author Comment

by:Kupi
ID: 9857018
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...
0
 
LVL 8

Expert Comment

by:fozylet
ID: 11961387
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.

fozylet
EE Cleanup Volunteer
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question