Solved

server-side javascript enabled detection

Posted on 2003-12-01
10
786 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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
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

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

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Index on a Table 6 35
Html value of radio 14 52
ASP and Extracting XML 7 43
Update the value of table B with value of table A tables inner join 6 94
I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
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…

738 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