PDA

View Full Version : check if java installed in HTML



fvmuijen
09-21-2007, 08:01 PM
Hi, i am just a starter with java.

i'm using some great scripts, BUT....
I've just reinstalled my laptop and now
a few of my java-scripts are only showing an annoying " X " :confused:
No script runs.

I know when i install the Java soft. from java.com, everything
will work nicely...
But why can i see the scripts at this site?.......

any help is welcome !

Thanks i.a.

Frans:)

boogyman
09-21-2007, 08:38 PM
java is not the same as javascript!

they are ENTIRELY different. Javascript was originally developed and had the name livescript / ECMA script but was later changed to javascript because Java was the "fad" of the time and the marketing team wanted to make it appear that javascript was derived from java, which it wasn't

javascript is a client-side web based language. meaning it is not evaluated and interpreted until an instance of a browser is initiated. where java is a full fledged programming language that can be placed inside a browser using small applets (mini-programs) and java can also access features of your root computer system inheritly, where javascript needs excess components that a user must accept before they can run.

jscheuer1
09-22-2007, 03:51 AM
I'm not sure that boogyman's answer is entirely accurate, but I am sure that it makes some good points. The most important one being that javascript and Java are two different things. However, both require an installed and enabled client side interpreter to operate for any given user. The javascript interpreter comes standard and enabled with virtually all modern browsers though, while the Java interpreter is a plug in and is in more limited distribution, but can 'come with' (be bundled with) a given browser. Java does support a much wider variety of operations than javascript, mainly as boogyman says, in accessing the user's computer. The lines become blurred though if you include with javascript Active X, which only works under the Internet Explorer browser.

For certain types of operations/effects, the user's experience of Java and javascript on a machine where both are installed and enabled can appear virtually identical/indistinguishable. And the two can work together, further blurring the lines between them.

jscheuer1
09-22-2007, 04:08 AM
Oh, and another thing - even though your post doesn't specifically ask this, your title does - how to detect Java availability.

The applet tag itself can include a param that checks for the installed version of Java. Different browsers react differently to this when the desired version isn't installed, but most present the user with an opportunity to download and install it.

Also, as with iframe tag for external pages and the object tag for Flash, the applet tag should (I'm not certain of this) allow one to include alternative content within it that will appear if the browser doesn't support the tag itself, ex:


<applet whatever="whatever">
<param name="whatever" value="whatever">
- - - Alternative content that can include HTML tags here - - -
</applet>