You can use js to applet communication transparently....
Netscape will use liveConnect and explorer activeX to do js to applet communication
but you
don't have to worry about that...
You'll need to code a getter method in your applet which will return the string..eg
----------------
private String str;
public String getString(){
return str
}
----------
and in js, you would go:
--------
<script language=javascript>
var str=appletname.getString();
</script>
---------
where appletname is the name you gave the applet in the <applet> tag....
(In fact, you can use java constructs directly in javaScript tags.. eg
System.out.println("test") ;)
I know this works in netscape and explorer v.4+ but not sure about earlier versions...
hope this helps
jesper,
Dmitri Namiot wrote:
> take a look at J2J servlet on http://coldjava.hypermart.net
>
> -------------------------------------------------------
> Hi All,
>
> Do we need to have live connect or something equivalent
> to call Java
> methods in JavaScript? I have tried with the code as
> mentioned in the mail
> using internet explorer. But I am getting javascript error
> message. When
> I tried
> to access public string attribute of the applet class, I am
> getting the
> message:
>
> undefined
>
> So I want to know what are the pre-requisite to communicate
> with java from
> javascript.
>
> ColdJava: java server side programming
> http://coldjava.hypermart.net
>
> ____________________________________________________________________
> Get your own FREE, personal Netscape WebMail account today at
>http://webmail.netscape.com.
>
> ===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets