By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,377 Members | 1,660 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,377 IT Pros & Developers. It's quick & easy.

javascript -> applet

P: n/a
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
Jul 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hi,

Jean-Luc Gyger wrote:
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/myjavascri...LiveConnect102

Laurent
--
Laurent Bugnion, GalaSoft
Webdesign, Java, javascript: http://www.galasoft-LB.ch
Private/Malaysia: http://mypage.bluewin.ch/lbugnion
Support children in Calcutta: http://www.calcutta-espoir.ch

Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.