In prior versions of IE and in Firefox, I am able to call methodFoo in JavaScript from my Java Applet running on the same page. In IE9, this no longer works. Is there some additional step, or a different way of doing this that will work for IE9?
My Java Applet contains
import netscape.javascript.JSObject;
...
private transient JSObject jso;
...
public void init() {
...
jso = JSObject.getWindow(this);
... }
public void CalledFromSecondaryThread(){
...
jso.call("methodFoo", object_to_pass);
... }
My Html page contains
...
<object style="height: 1px;width: 650px;" classid = "clsid:CAFEEFAC-0016-0000-0011-ABCDEFFEDCBA" codebase = "http://java.sun.com/update/1.6.0/jinstall-6u11-windows-i586.cab#Version=6,0,0,11" id="AppletControl">
<param name="java_arguments" value="-Xmx256m" />
<param name = "CODE" value = "com.namespace.Applet.class" />
<param name = "archive" value = "./lib/applet.jar" />
<param name = "type" value = "application/x-java-applet;version=1.6" />
<param name = "scriptable" value="true" />
<param name = "mayscript" value="true" /&g开发者_运维知识库t;
</object>
...
<script type="text/JavaScript" src="js/script.js"></script>
...
and script.js contains
function methodFoo(object_to_pass){
//doStuff
}
The Exception received from jso.call is
netscape.javascript.JSException: No such method "methodFoo" on JavaScript object
This was bug 620646 in IE 9 Beta - and has been fixed in the RC and newer versions of IE9 Bug Report at Microsoft
精彩评论