Actively call a JavaScript from a Applet.

Discussion in 'Javascript' started by Roberto Gallo, Feb 20, 2004.

  1. Hi everyone;


    * How can I actively call a Javascript function from inside a Applet?

    * What would be a good messaging system among some Applets inside the
    same page?

    Thank you very much.
    Roberto.
    Roberto Gallo, Feb 20, 2004
    #1
    1. Advertising

  2. Roberto Gallo

    Randy Webb Guest

    Roberto Gallo wrote:

    > Hi everyone;
    >
    >
    > * How can I actively call a Javascript function from inside a Applet?


    Ask in comp.lang.java
    java != javascript

    > * What would be a good messaging system among some Applets inside the
    > same page?
    >


    Ask in comp.lang.java
    java != javascript


    --
    Randy
    Chance Favors The Prepared Mind
    comp.lang.javascript FAQ - http://jibbering.com/faq/
    Randy Webb, Feb 20, 2004
    #2
    1. Advertising

  3. Randy Webb <> writes:

    > Ask in comp.lang.java
    > java != javascript


    I think the original poster knows that well enough, when he wants to
    call a Javascript function from inside the applet.

    That said, I think the solution will be in Java, so asking in a Java
    group could be better.

    Netscape's solution for Javascript/Java interaction is called
    LiveConnect (the original name for JavaScript was LiveScript, and I
    don't think it is a coincidence).

    <URL:http://developer.netscape.com/docs/technote/javascript/liveconnect/liveconnect_rh.html#Communicating with JavaScript from>

    So, to call the Javascript alert function, do:

    JSObject window = netscape.javascript.JSObject.getWindow();
    window.call("alert",new Object[]{"Test"});

    I don't know if it will work in IE, or with the MS-"JVM".

    >> * What would be a good messaging system among some Applets inside the
    >> same page?


    I don't know if there is anything better, but you can use LiveConnect,
    if permissions on the browser allows it.

    /L
    --
    Lasse Reichstein Nielsen -
    DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
    'Faith without judgement merely degrades the spirit divine.'
    Lasse Reichstein Nielsen, Feb 20, 2004
    #3
  4. Hi,

    Roberto Gallo wrote:
    > Hi everyone;
    >
    >
    > * How can I actively call a Javascript function from inside a Applet?


    See
    http://www.galasoft-lb.ch/myjavascript/consulting/LiveConnect102

    > * What would be a good messaging system among some Applets inside the
    > same page?


    See
    http://www.galasoft-lb.ch/myjava/CommTest/backup00/

    >
    > Thank you very much.
    > Roberto.


    Laurent
    --
    Laurent Bugnion, GalaSoft
    Software engineering: http://www.galasoft-LB.ch
    Private/Malaysia: http://mypage.bluewin.ch/lbugnion
    Support children in Calcutta: http://www.calcutta-espoir.ch
    Laurent Bugnion, Feb 22, 2004
    #4
    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. gaurav tyagi
    Replies:
    0
    Views:
    4,997
    gaurav tyagi
    Mar 18, 2006
  2. Gordon Beaton
    Replies:
    2
    Views:
    5,081
    Bryan Castillo
    Jul 8, 2003
  3. Replies:
    9
    Views:
    62,021
    ytterbius
    May 10, 2007
  4. Michael Malinowski
    Replies:
    4
    Views:
    376
    John Machin
    Dec 1, 2006
  5. Replies:
    8
    Views:
    225
    Swanagon, John M \(John\)
    Jul 25, 2006
Loading...

Share This Page