Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

Q4012 Can my JavaScript and my Java Applet on the same page talk to each other?

You are here: irt.org | FAQ | Java | Q4012 [ previous next ]

JavaScript code running on Netscape can reference the java AWT, Toolkit and most of the other Java objects and methods. It can also access public objects created in Java applets on a document. This does not seem to work always with Explorer. The general format of the code is something like this for JavaScript referencing Java objects or methods.

document.className.method();

There is an additional object model called JSObject that can be used from within a Java applet to access JavaScript objects in a document, but unfortunately the JSObject model is implemented differently in Netscape and Explorer, making it impossible to guarantee cross platform compatibility of Java Applets which reference JSObject! The general format for code is:

JSObject.objectname.method(); // OR
JSObject.objectname.property();

Feedback on 'Q4012 Can my JavaScript and my Java Applet on the same page talk to each other?'

©2018 Martin Webb