Connecting Tech Pros Worldwide Help | Site Map

Actively call a JavaScript from a Applet.

Roberto Gallo
Guest
 
Posts: n/a
#1: Jul 20 '05

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.



Randy Webb
Guest
 
Posts: n/a
#2: Jul 20 '05

re: Actively call a JavaScript from a Applet.


Roberto Gallo wrote:
[color=blue]
> Hi everyone;
>
>
> * How can I actively call a Javascript function from inside a Applet?[/color]

Ask in comp.lang.java
java != javascript
[color=blue]
> * What would be a good messaging system among some Applets inside the
> same page?
>[/color]

Ask in comp.lang.java
java != javascript


--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/

Lasse Reichstein Nielsen
Guest
 
Posts: n/a
#3: Jul 20 '05

re: Actively call a JavaScript from a Applet.


Randy Webb <hikksnotathome@aol.com> writes:
[color=blue]
> Ask in comp.lang.java
> java != javascript[/color]

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/t...#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".
[color=blue][color=green]
>> * What would be a good messaging system among some Applets inside the
>> same page?[/color][/color]

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 - lrn@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Laurent Bugnion
Guest
 
Posts: n/a
#4: Jul 20 '05

re: Actively call a JavaScript from a Applet.


Hi,

Roberto Gallo wrote:[color=blue]
> Hi everyone;
>
>
> * How can I actively call a Javascript function from inside a Applet?[/color]

See
http://www.galasoft-lb.ch/myjavascri...LiveConnect102
[color=blue]
> * What would be a good messaging system among some Applets inside the
> same page?[/color]

See
http://www.galasoft-lb.ch/myjava/CommTest/backup00/
[color=blue]
>
> Thank you very much.
> Roberto.[/color]

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

Closed Thread


Similar JavaScript / Ajax / DHTML bytes