This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Applets and the fly likes JavaScript to Java Applet Comm W/O Plug-in Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "JavaScript to Java Applet Comm W/O Plug-in" Watch "JavaScript to Java Applet Comm W/O Plug-in" New topic
Author

JavaScript to Java Applet Comm W/O Plug-in

Dennis Spathis
Greenhorn

Joined: Apr 12, 2001
Posts: 12
I've managed to figure out how to call applet methods from JavaScript using the Java Plug-in and the OBJECT tag in IE or the EMBED tag in Netscape.
I need to know how to do this, in IE and Netscape, without using the Java Plug-in. Actually, I know that in Netscape I can use LiveConnect and the regular APPLET tag. But I don't have a clue how to do this in IE. Could someone shed some light?
Thanks,
Dennis
Anubhuti Bhargava
Greenhorn

Joined: May 11, 2001
Posts: 9
hello,
I was also using javascript for jsp and applet communication , but it is giving me error "object does not support this property " could u send me the code wher u r calling applet method from jsp.??
regards
anubha

Originally posted by Dennis Spathis:
I've managed to figure out how to call applet methods from JavaScript using the Java Plug-in and the OBJECT tag in IE or the EMBED tag in Netscape.
I need to know how to do this, in IE and Netscape, without using the Java Plug-in. Actually, I know that in Netscape I can use LiveConnect and the regular APPLET tag. But I don't have a clue how to do this in IE. Could someone shed some light?
Thanks,
Dennis

David Kane
Ranch Hand

Joined: Sep 20, 2001
Posts: 65
You can do this in IE too, but you need to include the LiveConnect jar files in your distribution.
David
------------------
David Kane
david_kane@houseofyin.com
Author of Software Architecture: Organizational Principles and Patterns
http://www.vraps.com
http://www.houseofyin.com


David Kane<BR> <A HREF="mailto:david_kane@houseofyin.com" rel="nofollow">david_kane@houseofyin.com</A> <BR>Author of <A HREF="http://www.amazon.com/exec/obidos/ASIN/0130290327/ref=ase_electricporkchop/103-0514572-3811868" TARGET=_blank rel="nofollow">Software Architecture: Organizational Principles and Patterns</A><BR><A HREF="http://www.vraps.com" TARGET=_blank rel="nofollow">http://www.vraps.com</A><BR><A HREF="http://www.houseofyin.com" TARGET=_blank rel="nofollow">http://www.houseofyin.com</A>
Jay Lockwood
Greenhorn

Joined: Oct 19, 2001
Posts: 6
For the life of me, I can't get my browsers to recognize and call my applet method. Would you mind sending me or posting a snippet? Thanks in advance. -j
Originally posted by Dennis Spathis:
I've managed to figure out how to call applet methods from JavaScript using the Java Plug-in and the OBJECT tag in IE or the EMBED tag in Netscape.
Thanks,
Dennis

Rakesh Ray
Ranch Hand

Joined: Jul 25, 2001
Posts: 51
I can not understand what seems to be the problem.
Following is not enough to call (PUBLIC) applet method from any browser??
I am using it and working fine both in IE and Netscape!!
<HTML>
<HEAD>
<TITLE>Worksheet</TITLE>
<SCRIPT>
function submitRequest()
{
// MyF1 is applet and SaveWorksheet is a public method
// which takes
// String as a parameter.
document.MyF1.SaveWorksheet(document.wkshtForm.Note.value);
}
</SCRIPT>
</HEAD>
<BODY BGCOLOR="#cfcfcf">
<FORM NAME="wkshtForm" METHOD=GET
<APPLET CODE=WkShtApplet.class width=1000 HEIGHT=400 NAME="MyF1">
</APPLET>
<CENTER>
<B>Note: </B>
<BR>
<TEXTAREA NAME="Note" VALUE="" ROWS=5 COLS=51 WRAP=SOFT>
</TEXTAREA>
<BR>
<BR>
<INPUT TYPE=submit NAME="submitButton" VALUE=" SAVE " OnClick="submitRequest()"
>
<INPUT TYPE=reset NAME="cancelButon" VALUE="CANCEL" >
</CENTER>
</FORM>
</BODY>
</HTML>
~
Jay Lockwood
Greenhorn

Joined: Oct 19, 2001
Posts: 6
I am so sorry; I should have written that I can't call a public method in my SWING APPLET! I have been able to call public methods in non-swing applets.
Sorry...
Originally posted by Rakesh Ray:
I can not understand what seems to be the problem.
Following is not enough to call (PUBLIC) applet method from any browser??
I am using it and working fine both in IE and Netscape!!
~

Rakesh Ray
Ranch Hand

Joined: Jul 25, 2001
Posts: 51
You can find the answer here.. http://www.javaranch.com/ubb/Forum23/HTML/000760.html
pavan in
Ranch Hand

Joined: Oct 22, 2002
Posts: 64
Dennis,
can you post the code. I am not able to call applet method on netscape using plug-in.(EMBED) it works fine with IE (OBJECT)
Thanks.
 
 
subject: JavaScript to Java Applet Comm W/O Plug-in