javascript -> applet

J

Jean-Luc Gyger

Hello,

I have on a html page an applet. A javascript function call one function of
this applet. It works with IE but not with Mozilla or Netscape. I obtain
the following error on the java-plugin consol:

sun.plugin.liveconnect.OriginNotAllowedException: Javascript is not form the
same origin as je java code ...

This is my html code:

<script language="Javascript">
<!--
function askServerCmd()
{
return document.AppReaderLink.askServerCmd();

}
//-->
</script>
<applet CODE =" AppReaderLink.class"
codebase="."
ARCHIVE ="appredl.jar"
WIDTH =" 130"
HEIGHT =" 70"
NAME =" AppReaderLink"</applet>

I tri with jre 1.4.1_05 and jre 1.4.2_02 and I obtain the same thing.

What I have to do?

Sincerely

Jlg
 
L

Laurent Bugnion, GalaSoft

Hi,

Jean-Luc Gyger said:
Hello,

I have on a html page an applet. A javascript function call one function of
this applet. It works with IE but not with Mozilla or Netscape. I obtain
the following error on the java-plugin consol:

sun.plugin.liveconnect.OriginNotAllowedException: Javascript is not form the
same origin as je java code ...

This is my html code:

<script language="Javascript">
<!--
function askServerCmd()
{
return document.AppReaderLink.askServerCmd();

}
//-->
</script>
<applet CODE =" AppReaderLink.class"
codebase="."
ARCHIVE ="appredl.jar"
WIDTH =" 130"
HEIGHT =" 70"
NAME =" AppReaderLink"
</applet>

I tri with jre 1.4.1_05 and jre 1.4.2_02 and I obtain the same thing.

What I have to do?

Sincerely

Jlg

This should work, because you use the APPLET tag (in other words, your
applet was developed with JDK <= 1.1.

Try to remove the leading space in the CODE and NAME attribute. This
wouldn't be the first time that IE accepts spaces in attributes, and
Mozilla doesn't. If it still doesn't work, try to browse the following
page where a working example is shown. Maybe it helps.

http://www.galasoft-LB.ch/myjavascript/consulting/LiveConnect102

Laurent
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top