Java Tutorial/Trail: Java and Javascript: Difference between revisions

Content deleted Content added
Fasten (discuss | contribs)
mNo edit summary
Fasten (discuss | contribs)
m →‎Javascript to Java communication: Calling Java methods from Javascript is almost too easy
Line 35:
 
=== Javascript to Java communication ===
 
Calling Java methods from Javascript is almost too easy, because the Java code exposes all public functions, not just methods intended for communication with the enclosing HTML page. If the applet object has an id of "myApplet" the following code call into the Java applet:
:<code>myApplet.publicMethod ();</code>
It is even possible to call methods unrelated to the applet itself with the <code>Packages</code> keyword:
:<code>myApplet.Packages.java.lang.System.out.println ();</code>
 
== External links ==