I'm trying to call into a Java applet from Javascript but when I pass an object the Java applet only receives null. This works in IE and Firefox but not in Safari 4 (tried OSX and Windows version, neither seem to work).
The Java applet method I'm calling might look like:
public void sampleFunction(JSObject someobject) throws Exception
{
someobject.call("somemethod");
}
And the HTML/Javascript that calls it:
<applet archive="Test.jar" code="Test.class" width="0" height="0" id="TestApplet" MAYSCRIPT></applet>
...
var testobject = { somemethod: function() {} };
document.TestApplet.sampleFunction(testobject);
NullPointerException is the result in Safari because the "someobject" parameter in the Java applet is null. Again, this works fine in Firefox and IE in Windows, OSX, and Linux but in Safari the sampleFunction() will get passed a null parameter.
Also, the reverse direction doesn't seem to work either. If I get the window object and call into the Javascript from Java any objects I pass don't work. For example, I can pass an array of Strings and in the Javascript I get a [Ljava.lang.String type object but I can't access anything in it (length is undefined and the array operators don't work).
Is Safari just broken or what? Any ideas?