Jump to content

[SOLVED] Check if a user has JavaScript Enabled


chronister

Recommended Posts

Hi All,

I am completely ignorant of javascript and most of my javascript codes come from the free code sites. One day when I have the time and patience I will actually learn this stuff, until then I need your expertise to figure out how to check if javascript is enabled in a users browser and if it is not, then display a message.

I found the JavaScriptEnabled property and have not had much luck with figuring out exactly how to use it. An hour on Google produced nothing usable for me.

I found this, and it is not working for me... Any help or suggestions??

[code]
<script>
<!--
if (JavaScriptEnabled = 'No') {
    document.write("You Must Have Javascript Enabled to use this site.");
}
//-->
</script>
[/code]


Thanks in advance.

Nate
Better to have the default page be the one that works when JavaScript is disabled.
That way you can have it redirect to a JavaScript-rich page when JavaScript is enabled.

<script type="text/javascript">
<!--//
self.location.href = "withscript.htm";
//-->
</script>
<noscript>
<p>This page is for JavaScript-disabled clients.</p>
</noscript>
I feel dumb now... lol

I actually do know about the <noscript> tag, an that should have been my first item I tried...... Thanks folks.

I have a site that has js navigation and no alternative, its a family tree site, so its not used by lots and lots of people.... I will simply place a noscript tag in there in case anyone in my family has it disabled.

Thanks,

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.