Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IE6 Accessing java applets from javascript through DOM

Status
Not open for further replies.

mileruiz

Programmer
May 14, 2002
2
CO
hi,

I'm trying to communicate Java to JavaScript through the class netscape.javascript.JSObject. I'm using the method setMember to create a new object called API that is the applet itself and it works fine in Netscape 7.0 but it doesn't work in IE 6.0 for WinXP.

My applet code is something like this:

Code:
import netscape.javascript.*;
import java.applet.*;import java.awt.*;
class test extends Applet { 
    public void init() {         
    JSObject win = JSObject.getWindow(this);
    win.setMember("newDOMobject",this);       //here...i'm trying to create a new member of DOM model     
}
}

the HTML page looks like this:

Code:
<html><head><title>TEST</title></head><body><APPLET CODE="test.class" WIDTH=300 HEIGHT=300    MAYSCRIPT></APPLET></body></html>

if I check the java console I see this error:

netscape.javascript.JSException: unknown source

I think the setMember method doesn't accept to create a new object on DOM model.

any ideas?

thanks in advance
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top