我告诉你可以,给分吧!
呵呵……
小程序装入后,
<APPLET CODE="MMM.class" name="KKK">
用
window.document.KKK.XXX();访问
其中MMM是小程序的在html中的名字,XXX()是小程序的方法。
呵呵……
小程序装入后,
<APPLET CODE="MMM.class" name="KKK">
用
window.document.KKK.XXX();访问
其中MMM是小程序的在html中的名字,XXX()是小程序的方法。
例如:
在小程序里声明:
JSObject win,doc
win=JSObject.getWindow(this);
doc =(JSObject)win.getMember("document");
然后就可以使用win和doc了 win.eval(alert("可以了吗,请给分!!"));
JSObject 是在哪个包里,为什么找不到???
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Good luck!
import java.applet.*;
import java.awt.*;
class MyApplet extends Applet {
public void init() {
JSObject win = JSObject.getWindow(this);
JSObject doc = (JSObject) win.getMember("document");
JSObject loc = (JSObject) doc.getMember("location"); String s = (String) loc.getMember("href"); // document.location.href
win.call("f", null); // Call f() in HTML page
}
}
ftp://ftp.netscape.com/pub/sdk/plugin/windows/oct_21_97/winNPSDK.zip