Applet event handlers changed with Java 1.4.x?

J

Julian Hayward

I recently "inherited" a project which involves an applet on a web
page, and
some Javascript event handling functions. The handler definition looks
like
this:


<SCRIPT LANGUAGE=javascript FOR=Foo EVENT=mouseReleased>
<!--
Foo_mouseReleased();
//-->
</SCRIPT>

where Foo is an applet with parameter FiresScriptEvents set to TRUE.
The
function Foo_mouseReleased() is a simple javascript function that just
alerts
a fixed message so I know it's been called.

When I run this applet in a vanilla IE5.5 or IE6, it does exactly what
I expect - when the mouse is released, up pops my alert. BUT when I
run it on the same browser with Java Plug-In 1.4.2 installed, I don't
see it. Is there some compatibility issue with 1.4.x? Can the code be
changed relatively simply to work with both VMs, or am I looking at a
big rebuild to support browsers both with and without the plug-in?

Thanks a lot,

Julian
 
V

Vincent van Beveren

Java plugin is not from microsoft, I guess thats why its not
supported...

You could call JavaScript from Java using the Netscape package,
which, I thought, was included in Internet Explorer...

http://www.rgagnon.com/javadetails/java-0172.html

or you could attempt to use:

getAppletContext().showDocument(
new URL(
"javascript:alert('Hello')"));

Greetings,
Vincent
 
M

Martin Honnen

Julian said:
I recently "inherited" a project which involves an applet on a web
page, and
some Javascript event handling functions. The handler definition looks
like
this:


<SCRIPT LANGUAGE=javascript FOR=Foo EVENT=mouseReleased>
<!--
Foo_mouseReleased();
//-->
</SCRIPT>

The syntax <script for event> is basically an IE extension, it is not
supported by other browsers (at least not in general, the latest
Netscape 7.1 release makes some attempts but as far as I know only to
support Window Media Player scripting with Netscape 7.1/Windows).

where Foo is an applet with parameter FiresScriptEvents set to TRUE.

I have never heard of that parameter, and a search on
http://java.sun.com/ doesn't turn up any results. Nor does a search on
msdn.microsoft.com.
Where did you find that parameter, is it one specified for applets run
with the MS JVM?
The
function Foo_mouseReleased() is a simple javascript function that just
alerts
a fixed message so I know it's been called.

When I run this applet in a vanilla IE5.5 or IE6, it does exactly what
I expect - when the mouse is released, up pops my alert. BUT when I
run it on the same browser with Java Plug-In 1.4.2 installed, I don't
see it. Is there some compatibility issue with 1.4.x? Can the code be
changed relatively simply to work with both VMs, or am I looking at a
big rebuild to support browsers both with and without the plug-in?

I would be rather surprised if you can handle events happening inside of
a Java applet with script in the page containing the applet in a cross
browser way. I don't think that works with browsers using the Sun Java
plugin.
 

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

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top