Actively call a JavaScript from a Applet.

R

Roberto Gallo

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.
 
R

Randy Webb

Roberto said:
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
 
L

Lasse Reichstein Nielsen

Randy Webb said:
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".

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

/L
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,731
Messages
2,569,432
Members
44,835
Latest member
KetoRushACVBuy

Latest Threads

Top