开发者

In IE9 and IE9 Platform Preview, I am no longer able to call a Javascript method from my Java Applet

开发者 https://www.devze.com 2023-01-24 05:04 出处:网络
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 differen

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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号