By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,440 Members | 1,872 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,440 IT Pros & Developers. It's quick & easy.

Applet event handlers changed with Java 1.4.x?

P: n/a
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
Jul 23 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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

Julian Hayward wrote:
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


Jul 23 '05 #2

P: n/a


Julian Hayward wrote:
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.

--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.