javascript -> applet

Discussion in 'Javascript' started by Jean-Luc Gyger, Oct 29, 2003.

  1. 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
     
    Jean-Luc Gyger, Oct 29, 2003
    #1
    1. Advertising

  2. 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/myjavascript/consulting/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
     
    Laurent Bugnion, GalaSoft, Oct 30, 2003
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rob Love

    applet vs. canvas in applet

    Rob Love, Jul 7, 2003, in forum: Java
    Replies:
    1
    Views:
    635
    Liu, Chunyen
    Jul 7, 2003
  2. webster
    Replies:
    0
    Views:
    873
    webster
    Jul 20, 2003
  3. Andrew Thompson
    Replies:
    0
    Views:
    423
    Andrew Thompson
    Aug 5, 2003
  4. Blah Blah
    Replies:
    0
    Views:
    1,440
    Blah Blah
    Aug 13, 2003
  5. crazytazo
    Replies:
    3
    Views:
    1,271
    Daniel Pitts
    Oct 7, 2008
Loading...

Share This Page