javaEnabled() method

R

Ruskin

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.....
 
L

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.
 
R

Ruskin

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>
 
R

Richard Cornford

Ruskin said:
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.

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.
 

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,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top