How to detect if JavaScript is switched off

  • Thread starter Dilantha Seneviratne
  • Start date
D

Dilantha Seneviratne

Hi
Could someone advice me on how I detect if JavaScript is switched
off from a browser.

thanks
 
R

Randy Webb

Dennis said:
I have read the following message from Dilantha Seneviratne
<[email protected]>
and have decided to lend my vast knowledge.

The writer said:



and my reply is:
<noscript>
This line will display if there is no javascript
</noscript>

Or:

<script type="text/javascript">
document.location.href="jsEnabled.html";
</script>
<body>
If you read this, 100-1 Javascript is disabled
</body>
 
R

Richard Cornford

Dilantha Seneviratne said:
Could someone advice me on how I detect if JavaScript
is switched off from a browser.

It is unclear whether you are interested in detecting if a browser is
incapable of executing javascript or whether it is a browser that could
execute javascript but on which it has been disabled. It probably
doesn't matter in practice, as there won't be any way of telling the two
apart.

A test is only useful if you can do something with the result, and
without the ability to execute scripts there is nothing you can do in
response to the inability to execute scripts.

It is also the case that an ability on the part of a browser to execute
javascript does not mean that any given script will successfully execute
on that browsers.

Richard.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,681
Members
48,796
Latest member
Greg L.

Latest Threads

Top