Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

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

irt.org | Knowledge Base | Java | Q4012 [ previous next ]

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

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?'


Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.