473,383 Members | 1,803 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

javaEnabled() method

I'm confused (that's not too difficult to do)... But I read the write-up on
the javaEnabled() method;
window.navigator.javaEnabled()
States; the return value indicates if the preference that controls java is
turned on or off. It does NOT indicate if the browser supports java.

Ok, so if the user has java turned off, you can't run that method anyway!!!!
How do I tell if the user has java turned on or off and if the browser
supports java. Using this method, I can see if java is enabled, but there is
no way to tell if java is not enabled (either by the browser or by the user
turning it off). I have tried the <noscript> tag as well, but that doesn't
help....

What I am trying to do, is redirect the user to a different page, if there
browser is not capable of running java, or if they have java turned off.....



Jul 23 '05 #1
3 1446
OK.. Have answered my own question.. This seems to work;

<script language="javascript">
if (navigator.javaEnabled() == true) {
if (browserSupported() == false) {
window.location = "notsupported.asp?reason=browser";
}
} else {
window.location = "notsupported.asp?reason=script";
}
</script>

<noscript>
<!-- java is supported by the browser, but has been turned off.... -->
<meta http-equiv="Refresh"
content="0;url=notsupported.asp?reason=disabled">
</noscript>
"Ruskin" <ru******@nospam.xtra.com> wrote in message
news:7p*****************@news.xtra.co.nz...
I'm confused (that's not too difficult to do)... But I read the write-up on the javaEnabled() method;
window.navigator.javaEnabled()
States; the return value indicates if the preference that controls java is
turned on or off. It does NOT indicate if the browser supports java.

Ok, so if the user has java turned off, you can't run that method anyway!!!! How do I tell if the user has java turned on or off and if the browser
supports java. Using this method, I can see if java is enabled, but there is no way to tell if java is not enabled (either by the browser or by the user turning it off). I have tried the <noscript> tag as well, but that doesn't
help....

What I am trying to do, is redirect the user to a different page, if there
browser is not capable of running java, or if they have java turned off.....



Jul 23 '05 #2
Lee
Ruskin said:

I'm confused (that's not too difficult to do)... But I read the write-up on
the javaEnabled() method;
window.navigator.javaEnabled()
States; the return value indicates if the preference that controls java is
turned on or off. It does NOT indicate if the browser supports java.

Ok, so if the user has java turned off, you can't run that method anyway!!!!
How do I tell if the user has java turned on or off and if the browser
supports java. Using this method, I can see if java is enabled, but there is
no way to tell if java is not enabled (either by the browser or by the user
turning it off). I have tried the <noscript> tag as well, but that doesn't
help....

What I am trying to do, is redirect the user to a different page, if there
browser is not capable of running java, or if they have java turned off.....


You're confused about what Java is.
It's not Javascript, which is probably what you're really interested in.
Java is a completely different language.

Think about your problem from the other direction.
Redirect those who *do* have Javascript installed and enabled.

Jul 23 '05 #3
Ruskin wrote:
I'm confused <snip>

Fundamentally. Java and javascript are distinct programming languages
that share nothing but some letters in their names and syntaxes
reminiscent of C.
States; the return value indicates if the preference that controls
java is turned on or off. It does NOT indicate if the browser
supports java.

Ok, so if the user has java turned off, you can't
run that method anyway!!!!
it may be possible to execute javascript code when Java is disabled or
unavailable they are independent system that just have the potential to
interact.

<snip> Using this method, I can see if java is enabled,
That is not what the document you found says.
but there is no way to tell if java is not enabled (either
by the browser or by the user turning it off). I have tried the
<noscript> tag as well, but that doesn't help....
NOSCRIPT tags relate to javascript not Java, but have little or no
practical application as they represent a non-useful relationship with
the successful execution of scripts.
What I am trying to do, is redirect the user to a different page, if
there browser is not capable of running java, or if they have java
turned off.....


Java or javascript (if the answer is Java you are asking in the wrong
place) and _why_?

Richard.
Jul 23 '05 #4

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

Similar topics

11
by: Dave Rahardja | last post by:
OK, so I've gotten into a philosophical disagreement with my colleague at work. He is a proponent of the Template Method pattern, i.e.: class foo { public: void bar() { do_bar(); } protected:...
5
by: Chris | last post by:
Hi I have a scenario where I've created another AppDomain to dynamically load a DLL(s) into. In this newly loaded DLL I want to call a static method on a class. The problem arise is that I have...
4
by: daniel.w.gelder | last post by:
I wrote a template class that takes a function prototype and lets you store and call a C-level function, like this: inline string SampleFunction(int, bool) {..} functor<string (int, bool)>...
1
by: Charles Crume | last post by:
Hello; I am trying to test changes to my site (made only on my local machine so far) in IE v6, Mozilla 1.6, and Opera 7.5. When I test "navigator.javaEnabled in IE it corretly reports...
7
by: greenflame | last post by:
I am trying to make a matrix object. I have given it some properites. I am trying to add a method. When I call the method by Test.showDims(...) I want to only enter one input, that is the method by...
5
by: Nick Flandry | last post by:
I'm running into an Invalid Cast Exception on an ASP.NET application that runs fine in my development environment (Win2K server running IIS 5) and a test environment (also Win2K server running IIS...
18
by: JohnR | last post by:
From reading the documentation, this should be a relatively easy thing. I have an arraylist of custom class instances which I want to search with an"indexof" where I'm passing an instance if the...
10
by: Mihai Osian | last post by:
Hi everyone, Given the code below, can anyone tell me: a) Is this normal behaviour ? b) If it is, what is the reason behind it ? I would expect the A::method(int) to be inherited by B. ...
9
by: Steve Richter | last post by:
in a generic class, can I code the class so that I can call a static method of the generic class T? In the ConvertFrom method of the generic TypeConvert class I want to write, I have a call to...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.