Skip to main content

Applet-JS-Communication fails with next-gen Plugin

No replies
Joined: 2008-12-16

Our customers can't use several applets after upgrading to Java-Plugin 6_10 and 6_11. The problems can be solved by enabling the classic version, but this costs a lot of support time in our customer service center!

Problem details:

The applet uses the Netscape Live Connect API in order to set JavaScript variables in a page.

// HTML snipplet: the JS-variable to be set by the applet

var messageFromApplet;

// applet method that fails with the next-gen plugin but runs correctly
// with the classic mode
public class INIApplet extends Applet {

* converts the values into a string and writes
* the result to JavaScript variables
* @param ActionEvent event
public void actionPerformed(ActionEvent event)
//...some action
setJavaScriptVar( "messageFromApplet", "completed"); }

* the JavaScript variables in the page are set by the applet
* @param String var the name of the JavaScript variable
* @param String value the value of the JavaScript variable
private void setJavaScriptVar( String var, String value ) {
String strCommand = var + " = \""+ value + "\";";
JSObject win = JSObject.getWindow( this );
win.eval( strCommand );


// this snippet shows how the applet is included