javascript -> applet

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jean-Luc Gyger

    javascript -> applet

    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.live connect.OriginN otAllowedExcept ion: Javascript is not form the
    same origin as je java code ...

    This is my html code:

    <script language="Javas cript">
    <!--
    function askServerCmd()
    {
    return document.AppRea derLink.askServ erCmd();

    }
    //-->
    </script>
    <applet CODE =" AppReaderLink.c lass"
    codebase="."
    ARCHIVE ="appredl.ja r"
    WIDTH =" 130"
    HEIGHT =" 70"
    NAME =" AppReaderLink"[color=blue]
    >[/color]
    </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
  • Laurent Bugnion, GalaSoft

    #2
    Re: javascript -&gt; applet

    Hi,

    Jean-Luc Gyger wrote:
    [color=blue]
    > 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.live connect.OriginN otAllowedExcept ion: Javascript is not form the
    > same origin as je java code ...
    >
    > This is my html code:
    >
    > <script language="Javas cript">
    > <!--
    > function askServerCmd()
    > {
    > return document.AppRea derLink.askServ erCmd();
    >
    > }
    > //-->
    > </script>
    > <applet CODE =" AppReaderLink.c lass"
    > codebase="."
    > ARCHIVE ="appredl.ja r"
    > WIDTH =" 130"
    > HEIGHT =" 70"
    > NAME =" AppReaderLink"[color=green]
    > >[/color]
    > </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[/color]

    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.



    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

    Comment

    Working...