Connecting Tech Pros Worldwide Forums | Help | Site Map

How to detect if JavaScript is switched off

Dilantha Seneviratne
Guest
 
Posts: n/a
#1: Jul 20 '05
Hi
Could someone advice me on how I detect if JavaScript is switched
off from a browser.

thanks


Dennis M. Marks
Guest
 
Posts: n/a
#2: Jul 20 '05

re: How to detect if JavaScript is switched off


I have read the following message from Dilantha Seneviratne
<dilantha.seneviratne@caris.com>
and have decided to lend my vast knowledge.

The writer said:[color=blue]
> Hi
> Could someone advice me on how I detect if JavaScript is switched
> off from a browser.
>
> thanks
>
>[/color]

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

--
Dennis M. Marks
http://www.dcs-chico.com/~denmarks/
Replace domain.invalid with dcsi.net


-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
Randy Webb
Guest
 
Posts: n/a
#3: Jul 20 '05

re: How to detect if JavaScript is switched off


Dennis M. Marks wrote:
[color=blue]
> I have read the following message from Dilantha Seneviratne
> <dilantha.seneviratne@caris.com>
> and have decided to lend my vast knowledge.
>
> The writer said:
>[color=green]
>>Hi
>> Could someone advice me on how I detect if JavaScript is switched
>>off from a browser.
>>
>>thanks
>>
>>[/color]
>
>
> and my reply is:
> <noscript>
> This line will display if there is no javascript
> </noscript>
>[/color]

Or:

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

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/

Richard Cornford
Guest
 
Posts: n/a
#4: Jul 20 '05

re: How to detect if JavaScript is switched off


"Dilantha Seneviratne" <dilantha.seneviratne@caris.com> wrote in message
news:40312B96.B0052E3D@caris.com...[color=blue]
> Could someone advice me on how I detect if JavaScript
>is switched off from a browser.[/color]

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.


Closed Thread