473,479 Members | 2,128 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Javascript enabled ?

Hi,

Is it possible to check if the javascript is turn on on the browser (IE,
firefox, ...)?
Thanks,
Christian,
Jul 23 '05 #1
5 1810
In article <41*********************@news.skynet.be>, ml@cista.be says...
Hi,

Is it possible to check if the javascript is turn on on the browser (IE,
firefox, ...)?


Yes. Try executing some JS in your web page. If it runs, JS is
enabled. If it doesn't, it isn't.

--
Hywel http://kibo.org.uk/
I do not eat quiche.
Jul 23 '05 #2
"Christian Ista" <ml@cista.be> wrote in message
news:41*********************@news.skynet.be...
Hi,

Is it possible to check if the javascript is turn on on the browser (IE,
firefox, ...)?
Thanks,
Christian,


Here's one way. Watch for word-wrap.

<html>
<head>
<title>jsenabled.htm</title>
<script type="text/javascript">
function js() {
document.getElementById("JS").innerHTML = "JavaScript is enabled!"
}
</script>
</head>
<body onload="js()">
<span id="JS">JavaScript is not enabled!</span>
</body>
</html>

I doubt that it's cross-browser compatible -- we'll probably hear from
others!
Jul 23 '05 #3
McKirahan wrote on 28 dec 2004 in comp.lang.javascript:
"Christian Ista" <ml@cista.be> wrote in message
Is it possible to check if the javascript is turn on on the browser
(IE, firefox, ...)?

Here's one way. Watch for word-wrap.

<html>
<head>
<title>jsenabled.htm</title>
<script type="text/javascript">
function js() {
document.getElementById("JS").innerHTML = "JavaScript is enabled!"
}
</script>
</head>
<body onload="js()">
<span id="JS">JavaScript is not enabled!</span>
</body>
</html>


<html>
<head>
<title>jsNOTenabled.html</title>
<script type="text/javascript">
location.href = '/jsenabled.html'
</script>
</head>
<body>
JS NOT enabled
</body>
</html>
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 23 '05 #4
McKirahan wrote:
"Christian Ista" <ml@cista.be> wrote in message
news:41*********************@news.skynet.be...
Hi,

Is it possible to check if the javascript is turn on on the browser (IE,
firefox, ...)?
Thanks,
Christian,

Here's one way. Watch for word-wrap.

<html>
<head>
<title>jsenabled.htm</title>
<script type="text/javascript">
function js() {
document.getElementById("JS").innerHTML = "JavaScript is enabled!"


= "Javascript is enabled, your browser supports getElementById and it
supports innerHTML. Doesn't mean a lot though."

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq
Jul 23 '05 #5
JRS: In article <41*********************@news.skynet.be>, dated Tue, 28
Dec 2004 17:57:21, seen in news:comp.lang.javascript, Christian Ista
<ml@cista.be> posted :

Is it possible to check if the javascript is turn on on the browser (IE,
firefox, ...)?


You should first ask yourself how the information might be used; or, if
you know, explain your intent.

ISTM perfectly possible (untested) to do something like

<script type="text/VBScript"> dim JSisON : JSisON=false </script>

<script type="text/javascript"> JSisON=true </script>

<script type="text/VBScript">
document.write " JS is ON is ", JSisON </script>

but rather unusual.

Otherwise, what you ask is not entirely unlike asking what the result of
your own last round of Russian Roulette was.

One possibility is to put on the first page, presumably at the top,

<script type="text/javascript"> location.href = "XX.htm" </script>

Page XX.htm will be reached when javascript is enabled; otherwise, the
first page remains scriptlessly active.

--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4 ©
<URL:http://www.jibbering.com/faq/> JL/RC: FAQ of news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
Jul 23 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
1459
by: Jim Simpson | last post by:
I'm working with Perl and trying to write a Perl script that will access sites requiring a "password". Each time I run my code I get the following message: <noscript> <br> <b> We have detected...
13
8434
by: Alex Molochnikov | last post by:
Is there any way to find out programmatically if Javascript is supported/enabled in a browser? By "programmatically" I mean on the Java servlet side. TIA Alex Molochnikov Gestalt Corporation
9
3047
by: SHarris | last post by:
Hello, In our new intranet ASP.NET project, two requirements are that the browser accept cookies AND JavaScript. We are requiring the use of Internet Explorer 6+. 1. Using C# in an ASP.NET...
10
1908
by: David Thielen | last post by:
Hi; When a user clicks a radio button, what I would like to do is that if javascript is enabled on their browser, it calls a javascript function and does not do a postback. If javascript is...
6
61587
by: Jim | last post by:
How do I check if javascript is enabled in PHP? TIA, Jim
7
3181
by: julian.tklim | last post by:
Hi, I need to build an editable Datagrid with add & delete buttons on each row using javascript. DataGrid need not be pre-populated with values. To make the thing complicated, one of the...
8
2832
by: Taras_96 | last post by:
Hi everyone, We' ve come to the conclusion that we wish the user to be directed to an error page if javascript is disabled <enter comment about how a webpage shouldn't rely on javascript here :)...
3
2566
by: WayneH | last post by:
Hi - I'm trying to use javascript to determine if a user's browser has cookies enabled or not. To test: copy this code into a file with a 'html' extension, and load it into your IE browser...
12
2773
by: Anic297 | last post by:
Hi, This is certainly a simple question, but I'm a newbie in JavaScript. Is there a way to know if JavaScript is enabled? My php script uses JavasSript to do something. If JavaScript is not...
0
7027
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7019
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7067
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6719
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5312
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4757
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4463
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2980
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
166
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.