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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to check for javascript enabled?

Status
Not open for further replies.

Thoe99

Programmer
May 11, 2001
119
US
I've got a site that has one javascript running, and I want it to check to see if the user has it enabled. If not, I will re-direct them to another page. Does anyone know the html coding for that?

 
actually it will be much simpler to do it the other way around! IF javascript IS enabled you can redirect using a javascript otherwise nothing happens.

One thing to bear in mind though Search Engines could view this as "cloaking"



Chris.

Indifference will be the downfall of mankind, but who cares?
 
That sounds like a good idea, but I don't like the idea of most users having to be redirected. I only want those without javascript to be redirected, cuz they're a minority. Can you explain what cloaking is?

 
Cloaking is when SEs spiders are shown one lot of content and the browsers a different content and because spiders aren't javascript enabled (yet) they would see the alternative.

Another option open to you would be to put your alternative to the scripted content between <noscript>...</noscript> tags this would show only in browsers with scripting turned off.



Chris.

Indifference will be the downfall of mankind, but who cares?
 
to code the quote of Chris
[qute]
<body>
<noscript>
JS Haters Please Click <a href="/nojs/Index.html">Continue</a> as your JS is dissabled! :)
</noscript>
</body>
[/qute]

detection of JS:

HTH
All the best!

> need more info?
:: don't click HERE ::
 
ops...sorry for the tags

> need more info?
:: don't click HERE ::
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top