Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Check if JavaScript is enabled 3

Status
Not open for further replies.

vickero007

IS-IT--Management
Apr 1, 2003
308
US
Is there a way to check if JavaScript is enabled? Maybe with ASP or something like that.

-Volkoff007
 
you put text between <noscript> tags

<noscript>
you don't have javascript enabled.
</noscript>

i think asp can do it server-side too.



=========================================================
try { succeed(); } catch(E) { tryAgain(); }
-jeff
 
can write the page to redirect to a <script> only site like this....

<script>
document.location = &quot;javascriptSiteURL&quot;
</script>

now write a non javascript page here....



OR on the link to enter the site....

<a href=&quot;nonJSpageURL&quot; onClick=&quot;document.location='jsSiteURL'; return false&quot;>Enter my site</a>

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook
 
Hope this help


<HTML>
<HEAD>

</Head>
<META name=&quot;GENERATOR&quot; content=&quot;Microsoft Visual Studio 6.0&quot;>
<TITLE>CERDetails Table Structure</TITLE>

<BODY>
<FORM NAME=&quot;test&quot; ACTION=&quot;chico2.asp&quot; METHOD=&quot;POST&quot;>
<table>
<%
Set Session(&quot;bc&quot;) = Server.CreateObject(&quot;MSWC.BrowserType&quot;) %>
Browser: <%= Session(&quot;bc&quot;).browser %><BR>
Version: <%= Session(&quot;bc&quot;).version %><BR>

Supports VBScript?
<% If (Session(&quot;bc&quot;).vbscript = &quot;True&quot;) then %>
Yes<BR>
<% Else %>
No<BR>
<% End If %>
Supports JavaScript?
<% If (Session(&quot;bc&quot;).javascript = &quot;True&quot;) then %>
Yes<BR>
<% Else %>
No<BR>
<% End If %>
<br><br>

</table>
</form>
</BODY>
</HTML>
 
Another way:
<form name=&quot;sForm&quot; action=&quot;&quot;>
<input type=&quot;hidden&quot; name=&quot;jsEnabled&quot; value=&quot;false&quot; />
</form>
<script type=&quot;text/javascript&quot;>
document.sForm.jsEnabled.value = &quot;true&quot;;
</script>


&quot;News and views of some obscure guy&quot;
 
I think the server side test will be limited by the fact that the server has no way of knowing whether script is enabled on the client. For instance, if I visit your site using IE6 but I have it asssigned to the RESTRICTED Zone, your script won't run.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top